|
1 | | -name: C++ CI Workflow with conda-forge dependencies |
| 1 | +name: C++ CI Workflow with pixi dependencies |
2 | 2 |
|
3 | 3 | on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + delete_pixi_lock: |
| 7 | + description: 'If true, delete pixi.lock, to test against the latest version of dependencies.' |
| 8 | + required: true |
| 9 | + default: 'false' |
4 | 10 | push: |
5 | 11 | branches: |
6 | 12 | - master |
|
10 | 16 | # Execute a "nightly" build at 2 AM UTC |
11 | 17 | - cron: '0 2 * * *' |
12 | 18 |
|
13 | | -# Workaround for https://github.com/conda-forge/mumps-feedstock/issues/125 |
14 | | -# and https://github.com/conda-forge/mumps-feedstock/pull/126#issuecomment-2355357834 |
15 | | -env: |
16 | | - OMP_NUM_THREADS: 1 |
17 | | - |
18 | 19 | jobs: |
19 | 20 | build: |
20 | | - name: '[${{ matrix.os }}@${{ matrix.build_type }}@conda]' |
| 21 | + name: '[${{ matrix.os }}@pixi]' |
21 | 22 | runs-on: ${{ matrix.os }} |
22 | 23 | strategy: |
23 | 24 | matrix: |
24 | | - build_type: [Release] |
25 | | - os: [ubuntu-latest, windows-2022, macos-latest] |
| 25 | + os: [ubuntu-latest, windows-latest, macos-latest] |
26 | 26 | fail-fast: false |
27 | 27 |
|
28 | 28 | steps: |
29 | | - - uses: actions/checkout@v4 |
30 | | - |
31 | | - - uses: conda-incubator/setup-miniconda@v3 |
32 | | - with: |
33 | | - miniforge-variant: Miniforge3 |
34 | | - miniforge-version: latest |
35 | | - channels: conda-forge,robostack-jazzy |
36 | | - channel-priority: true |
37 | | - conda-remove-defaults: true |
38 | | - |
39 | | - - name: Dependencies |
40 | | - shell: bash -l {0} |
41 | | - run: | |
42 | | - # Dependencies |
43 | | - # ros2-distro-mutex=0.13.* is a workaround for https://github.com/gbionics/bipedal-locomotion-framework/pull/1013#issuecomment-3932062597 |
44 | | - conda install cmake compilers make ninja pkg-config \ |
45 | | - "idyntree>=12.2.1" "yarp>=3.5.0" libmatio libmatio-cpp librobometry \ |
46 | | - liblie-group-controllers eigen qhull "casadi>=3.5.5" cppad "spdlog>=1.15.1" \ |
47 | | - nlohmann_json manif manifpy pybind11 numpy pytest scipy opencv pcl \ |
48 | | - tomlplusplus libunicycle-footstep-planner "icub-models>=1.23.4" libtrintrin \ |
49 | | - ros2-distro-mutex=0.13.* ros-jazzy-rclcpp onnxruntime-cpp libbayes-filters-lib cmake-package-check catch2 |
50 | | -
|
51 | | - - name: Linux-only Dependencies [Linux] |
52 | | - if: contains(matrix.os, 'ubuntu') |
53 | | - shell: bash -l {0} |
54 | | - run: | |
55 | | - conda install manifpy libgl-devel |
56 | | -
|
57 | | - - name: Windows-only Dependencies [Windows] |
58 | | - if: contains(matrix.os, 'windows') |
59 | | - shell: bash -l {0} |
60 | | - run: | |
61 | | - # pybind11 constrained as workaround for https://github.com/conda-forge/pybind11-feedstock/issues/95 |
62 | | - conda install vs2022_win-64 "pybind11<2.12.0" |
63 | | -
|
64 | | - - name: Windows-workarounds [Windows] |
65 | | - if: contains(matrix.os, 'windows') |
66 | | - shell: cmd /C CALL {0} |
67 | | - run: | |
68 | | - :: We delete all the Python executables installed by GitHub Actions as a workaround for https://github.com/ami-iit/bipedal-locomotion-framework/pull/910#issuecomment-2589862552 |
69 | | - :: once that is not necessary anymore, remove this |
70 | | - rmdir /s /q C:\hostedtoolcache\windows\Python |
| 29 | + - uses: actions/checkout@v6 |
71 | 30 |
|
72 | | - - name: Print used environment |
73 | | - shell: bash -l {0} |
| 31 | + # On periodic jobs and when delete_pixi_lock option is true, delete the pixi.lock to check that the project compiles with latest version of dependencies |
| 32 | + - name: Delete pixi.lock on scheduled jobs or if delete_pixi_lock is true |
| 33 | + if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.delete_pixi_lock == 'true') |
| 34 | + shell: bash |
74 | 35 | run: | |
75 | | - conda list |
76 | | - env |
| 36 | + rm pixi.lock |
77 | 37 |
|
78 | | - - name: Configure [Linux&macOS] |
79 | | - if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') |
80 | | - shell: bash -l {0} |
81 | | - run: | |
82 | | - mkdir -p build |
83 | | - cd build |
84 | | - cmake -GNinja -DBUILD_TESTING:BOOL=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ |
85 | | - -DFRAMEWORK_COMPILE_PYTHON_BINDINGS:BOOL=ON -DUSE_SYSTEM_Catch2:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. |
| 38 | + - name: Set up pixi |
| 39 | + uses: prefix-dev/setup-pixi@v0.9.4 |
86 | 40 |
|
87 | | - - name: Build [Linux&macOS] |
88 | | - if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') |
89 | | - shell: bash -l {0} |
90 | | - run: | |
91 | | - cd build |
92 | | - cmake --build . --config ${{ matrix.build_type }} |
| 41 | + - uses: hendrikmuhs/ccache-action@v1.2 |
93 | 42 |
|
94 | | - - name: Test [Linux&macOS] |
95 | | - if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') |
96 | | - shell: bash -l {0} |
| 43 | + - name: Print pixi info |
97 | 44 | run: | |
98 | | - cd build |
99 | | - ctest --output-on-failure -C ${{ matrix.build_type }} |
| 45 | + pixi info |
100 | 46 |
|
101 | | - - name: Install and test installed package [Linux&macOS] |
102 | | - if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') |
103 | | - shell: bash -l {0} |
104 | | - run: | |
105 | | - cd build |
106 | | - cmake --install . --config ${{ matrix.build_type }} |
107 | | - cmake-package-check BipedalLocomotionFramework --targets BipedalLocomotion::Framework |
| 47 | + - name: Configure |
| 48 | + run: pixi run configure |
108 | 49 |
|
109 | | - - name: Configure [Windows] |
110 | | - if: contains(matrix.os, 'windows') |
111 | | - shell: cmd /C call {0} |
112 | | - run: | |
113 | | - mkdir -p build |
114 | | - cd build |
115 | | - cmake -GNinja -DBUILD_TESTING:BOOL=ON -DFRAMEWORK_COMPILE_PYTHON_BINDINGS:BOOL=ON -DUSE_SYSTEM_Catch2:BOOL=ON -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. |
| 50 | + - name: Build |
| 51 | + run: pixi run build |
116 | 52 |
|
117 | | - - name: Build [Windows] |
118 | | - if: contains(matrix.os, 'windows') |
119 | | - shell: cmd /C call {0} |
120 | | - run: | |
121 | | - cd build |
122 | | - cmake --build . --config ${{ matrix.build_type }} |
123 | | -
|
124 | | - - name: Test [Windows] |
125 | | - if: contains(matrix.os, 'windows') |
126 | | - shell: cmd /C call {0} |
127 | | - run: | |
128 | | - cd build |
129 | | - :: Python as a workaround for https://github.com/ami-iit/bipedal-locomotion-framework/issues/992 |
130 | | - ctest --output-on-failure -C ${{ matrix.build_type }} -E "Python" |
| 53 | + - name: Test |
| 54 | + run: pixi run test |
131 | 55 |
|
132 | | - - name: Install and test installed package [Windows] |
133 | | - if: contains(matrix.os, 'windows') |
134 | | - shell: cmd /C call {0} |
135 | | - run: | |
136 | | - cd build |
137 | | - cmake --install . --config ${{ matrix.build_type }} |
138 | | - cmake-package-check BipedalLocomotionFramework --targets BipedalLocomotion::Framework |
| 56 | + - name: Install and test installed package |
| 57 | + run: pixi run cmake-package-check BipedalLocomotionFramework --targets BipedalLocomotion::Framework |
0 commit comments