Skip to content

Commit a3aaedc

Browse files
committed
Add pixi support and migrate CI from conda to pixi
1 parent 0d6df77 commit a3aaedc

5 files changed

Lines changed: 35350 additions & 109 deletions

File tree

Lines changed: 28 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
name: C++ CI Workflow with conda-forge dependencies
1+
name: C++ CI Workflow with pixi dependencies
22

33
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'
410
push:
511
branches:
612
- master
@@ -10,129 +16,42 @@ on:
1016
# Execute a "nightly" build at 2 AM UTC
1117
- cron: '0 2 * * *'
1218

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-
1819
jobs:
1920
build:
20-
name: '[${{ matrix.os }}@${{ matrix.build_type }}@conda]'
21+
name: '[${{ matrix.os }}@pixi]'
2122
runs-on: ${{ matrix.os }}
2223
strategy:
2324
matrix:
24-
build_type: [Release]
25-
os: [ubuntu-latest, windows-2022, macos-latest]
25+
os: [ubuntu-latest, windows-latest, macos-latest]
2626
fail-fast: false
2727

2828
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
7130

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
7435
run: |
75-
conda list
76-
env
36+
rm pixi.lock
7737
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
8640

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
9342

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
9744
run: |
98-
cd build
99-
ctest --output-on-failure -C ${{ matrix.build_type }}
45+
pixi info
10046
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
10849

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
11652

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
13155

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
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Update pixi lockfile"
2+
3+
permissions:
4+
contents: write
5+
pull-requests: write
6+
7+
on:
8+
workflow_dispatch:
9+
schedule:
10+
- cron: '0 5 1 */3 *'
11+
12+
jobs:
13+
pixi-update:
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- uses: actions/checkout@v6
17+
18+
- name: Set up pixi
19+
uses: prefix-dev/setup-pixi@v0.9.4
20+
with:
21+
run-install: false
22+
23+
- name: Install pixi-diff-to-markdown
24+
run: pixi global install pixi-diff-to-markdown
25+
26+
- name: Update lockfile
27+
run: |
28+
set -o pipefail
29+
pixi update --json | pixi exec pixi-diff-to-markdown >> diff.md
30+
31+
- name: Create pull request
32+
uses: peter-evans/create-pull-request@v6
33+
with:
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
commit-message: Update pixi lockfile
36+
title: Update pixi lockfile
37+
body-path: diff.md
38+
branch: update-pixi
39+
base: master
40+
delete-branch: true
41+
add-paths: pixi.lock

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# build folders
22
build*
3+
.build*
34

45
# emacs
56
*~

0 commit comments

Comments
 (0)