-
Notifications
You must be signed in to change notification settings - Fork 52
Refactor CMake with JRL CMake Modules v2 #612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Changes from all commits
d7891ea
81510e3
2d8f082
3fe00a8
73985ba
6c2b41d
d609c3e
17dc6d1
84a5e56
7b1036b
76f7779
a563812
7ac1f4d
3a21055
e3fbb2c
b1a0d31
e9217c8
9aeb376
a81417f
f41b8ad
2d23171
a147ff0
21a5f63
ad54eb7
b178695
d54b652
fbf70c7
9c94fc8
a537e4d
6773e71
f0a36d1
4c84995
69fc264
ffea32c
0da51b4
6a28c43
70467c7
4425f8b
f615983
fb2f9a1
a29e585
178fcaa
a6ced57
d9df997
45b2bb6
1566dc8
0d2d834
3f4a0db
75446bc
095c191
bef6b7f
33e2131
8c490fd
1a75903
2f8cae2
0ddd8dc
fe26706
7e979c5
66b5735
8eff752
b97a147
9ac408d
f8cd863
0519a1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| BasedOnStyle: Google | ||
| SortIncludes: false | ||
| Standard: Cpp11 | ||
| Standard: c++17 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| definitions: [./CMakeLists.txt, ./unittest, ./python] | ||
| line_length: 100 | ||
| indent: 2 | ||
| warn_about_unknown_commands: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,63 +1,90 @@ | ||
| name: CI - Linux via APT | ||
| name: CI - Linux (APT) | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - devel | ||
| paths-ignore: | ||
| - 'doc/**' | ||
| - '.gitlab-ci.yml' | ||
| - '.gitignore' | ||
| - '*.md' | ||
| - 'LICENSE' | ||
| - 'colcon.pkg' | ||
| - '.pre-commit-config.yaml' | ||
| - "doc/**" | ||
| - ".gitlab-ci.yml" | ||
| - ".gitignore" | ||
| - "*.md" | ||
| - "LICENSE" | ||
| - "colcon.pkg" | ||
| - ".pre-commit-config.yaml" | ||
| pull_request: | ||
| paths-ignore: | ||
| - 'doc/**' | ||
| - '.gitlab-ci.yml' | ||
| - '.gitignore' | ||
| - '*.md' | ||
| - 'LICENSE' | ||
| - 'colcon.pkg' | ||
| - '.pre-commit-config.yaml' | ||
| - "doc/**" | ||
| - ".gitlab-ci.yml" | ||
| - ".gitignore" | ||
| - "*.md" | ||
| - "LICENSE" | ||
| - "colcon.pkg" | ||
| - ".pre-commit-config.yaml" | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| name: "Test python ${{ matrix.python }} on ${{ matrix.ubuntu }}.04" | ||
| runs-on: "ubuntu-${{ matrix.ubuntu }}.04" | ||
| ubuntu: | ||
| name: CI - ${{ matrix.os }} - ${{ matrix.build_type }} (APT) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python: [3] | ||
| ubuntu: [22, 24] | ||
| os: [ubuntu-22.04, ubuntu-24.04] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use docker container |
||
| build_type: [Release, Debug] | ||
| env: | ||
| CCACHE_BASEDIR: ${{ github.workspace }} | ||
| CCACHE_DIR: ${{ github.workspace }}/.ccache | ||
| CCACHE_COMPRESS: true | ||
| CCACHE_COMPRESSLEVEL: 6 | ||
| CMAKE_C_COMPILER_LAUNCHER: ccache | ||
| CMAKE_CXX_COMPILER_LAUNCHER: ccache | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Setup ccache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| submodules: 'true' | ||
| - run: | | ||
| sudo apt-get update | ||
| sudo apt-get install cmake libboost-all-dev libeigen3-dev python*-numpy python*-dev python*-scipy | ||
| echo $(sudo apt list --installed) | ||
| echo $(g++ --version) | ||
| - run: cmake . -DPYTHON_EXECUTABLE=$(which python${{ matrix.python }}) -DBUILD_TESTING_SCIPY=ON | ||
| - run: make -j2 | ||
| - run: ctest --output-on-failure | ||
| path: ${{ env.CCACHE_DIR }} | ||
| key: ccache-${{ matrix.os }}-${{ matrix.build_type }}-${{ github.sha }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Find an unique prefix (cf github cache discussion in macos-linux-windows-pixi workflow) |
||
| restore-keys: ccache-${{ matrix.os }}-${{ matrix.build_type }}- | ||
|
|
||
| - name: Update APT repositories | ||
| run: sudo apt-get update | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can remove all |
||
|
|
||
| - name: Install dependencies via APT | ||
| run: sudo apt-get install -y cmake ninja-build ccache libboost-all-dev libeigen3-dev python3-numpy python3-dev python3-scipy | ||
|
|
||
| - name: Clear ccache stats | ||
| run: ccache --show-stats --zero-stats --verbose | ||
|
|
||
| - name: CMake Configure | ||
| run: /usr/bin/cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DBUILD_TESTING_SCIPY=ON | ||
|
|
||
| - name: CMake Build | ||
| run: /usr/bin/cmake --build build --verbose --parallel 2 | ||
|
|
||
| - name: Show ccache stats | ||
| run: ccache --show-stats --verbose | ||
|
|
||
| - name: CTest | ||
| run: /usr/bin/ctest --test-dir build --output-on-failure | ||
|
|
||
| - name: CMake Install | ||
| run: /usr/bin/cmake --install build --prefix install | ||
|
|
||
| check: | ||
| if: always() | ||
| name: check-linux | ||
|
|
||
| needs: | ||
| - test | ||
| - ubuntu | ||
|
|
||
| runs-on: Ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Decide whether the needed jobs succeeded or failed | ||
| uses: re-actors/alls-green@release/v1 | ||
| with: | ||
| jobs: ${{ toJSON(needs) }} | ||
| - name: Decide whether the needed jobs succeeded or failed | ||
| uses: re-actors/alls-green@release/v1 | ||
| with: | ||
| jobs: ${{ toJSON(needs) }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,11 +27,11 @@ concurrency: | |
|
|
||
| jobs: | ||
| eigenpy-pixi: | ||
| name: Standard - ${{ matrix.os }} - Env ${{ matrix.environment }} ${{ matrix.build_type }} ${{ matrix.cxx_options }} ${{ matrix.compiler }} | ||
| name: Pixi - ${{ matrix.os }} - Env ${{ matrix.environment }} ${{ matrix.build_type }} ${{ matrix.cxx_options }} | ||
| runs-on: ${{ matrix.os }} | ||
| env: | ||
| CCACHE_BASEDIR: "${GITHUB_WORKSPACE}" | ||
| CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache" | ||
| CCACHE_BASEDIR: ${{ github.workspace }} | ||
| CCACHE_DIR: ${{ github.workspace }}/.ccache | ||
| CCACHE_COMPRESS: true | ||
| CCACHE_COMPRESSLEVEL: 6 | ||
| # Since pixi will install a compiler, the compiler mtime will be changed. | ||
|
|
@@ -64,35 +64,41 @@ jobs: | |
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - uses: actions/cache@v5 | ||
| with: | ||
| path: .ccache | ||
| key: ccache-macos-linux-windows-pixi-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-${{ matrix.environment }}-${{ github.sha }} | ||
| restore-keys: ccache-macos-linux-windows-pixi-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-${{ matrix.environment }}- | ||
| path: ${{ env.CCACHE_DIR }} | ||
| key: ccache-${{ matrix.os }}-${{ matrix.build_type }}-${{ github.sha }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to keep cxx_options and environment. You also need to keep
|
||
| restore-keys: ccache-${{ matrix.os }}-${{ matrix.build_type }}- | ||
|
|
||
| - uses: prefix-dev/setup-pixi@v0.9.5 | ||
| with: | ||
| cache: true | ||
| environments: ${{ matrix.environment }} | ||
|
|
||
| - name: Clear ccache statistics [MacOS/Linux/Windows] | ||
| run: | | ||
| pixi run -e ${{ matrix.environment }} ccache -z | ||
| pixi run -e ${{ matrix.environment }} ccache --show-stats --zero-stats --verbose | ||
|
|
||
| - name: Build EigenPy [MacOS/Linux/Windows] | ||
| - name: Configure EigenPy [MacOS/Linux/Windows] | ||
| env: | ||
| CMAKE_BUILD_PARALLEL_LEVEL: 2 | ||
| EIGENPY_BUILD_TYPE: ${{ matrix.build_type }} | ||
| EIGENPY_CXX_FLAGS: ${{ matrix.cxx_options }} | ||
| run: | | ||
| pixi run -e ${{ matrix.environment }} configure | ||
|
|
||
| - name: Build EigenPy [MacOS/Linux/Windows] | ||
| env: | ||
| CMAKE_BUILD_PARALLEL_LEVEL: 2 | ||
| run: | | ||
| pixi run -e ${{ matrix.environment }} build --verbose --parallel 2 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By running |
||
|
|
||
| - name: Test EigenPy [MacOS/Linux/Windows] | ||
| run: | | ||
| pixi run -e ${{ matrix.environment }} test | ||
|
|
||
| - name: Show ccache statistics [MacOS/Linux/Windows] | ||
| run: | | ||
| pixi run -e ${{ matrix.environment }} ccache -sv | ||
| pixi run -e ${{ matrix.environment }} ccache --show-stats --verbose | ||
|
|
||
| # eigenpy-pixi-build: | ||
| # name: Pixi build - ${{ matrix.os }} | ||
|
|
@@ -105,14 +111,12 @@ jobs: | |
|
|
||
| # steps: | ||
| # - uses: actions/checkout@v6 | ||
| # with: | ||
| # submodules: recursive | ||
|
|
||
| # - uses: prefix-dev/setup-pixi@v0.9.5 | ||
| # env: | ||
| # CMAKE_BUILD_PARALLEL_LEVEL: 2 | ||
| # with: | ||
| # cache: true | ||
| # cache: false # ⚠️ Disabling cache for testing ⚠️ | ||
| # environments: test-pixi-build | ||
|
|
||
| # - name: Test package [MacOS/Linux/Windows] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update after jrl-next release