Skip to content

Commit 1e782f8

Browse files
committed
Add pixi support, pixi CI
1 parent ea7c00e commit 1e782f8

File tree

2 files changed

+147
-0
lines changed

2 files changed

+147
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI - OSX/Linux via Pixi
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'doc/**'
7+
- '.gitignore'
8+
- '*.md'
9+
- 'CHANGELOG.md'
10+
pull_request:
11+
paths-ignore:
12+
- 'doc/'
13+
- '.gitignore'
14+
- '*.md'
15+
- 'CHANGELOG.md'
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
simple-mpc-pixi:
22+
name: ${{ matrix.os }} - Env ${{ matrix.environment }} ${{ matrix.build_type }}
23+
runs-on: ${{ matrix.os }}
24+
env:
25+
CCACHE_BASEDIR: "${GITHUB_WORKSPACE}"
26+
CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache"
27+
CCACHE_COMPRESS: true
28+
CCACHE_COMPRESSLEVEL: 6
29+
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
os: [ubuntu-latest, macos-latest]
34+
environment: [all]
35+
build_type: [Release, Debug]
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
submodules: recursive
41+
42+
- uses: actions/cache@v4
43+
with:
44+
path: .ccache
45+
key: ccache-macos-linux-pixi-${{ matrix.os }}-${{ matrix.build_type }}-${{ github.sha }}
46+
restore-keys: ccache-macos-linux-pixi-${{ matrix.os }}-${{ matrix.build_type }}-
47+
48+
- uses: prefix-dev/[email protected]
49+
with:
50+
pixi-version: v0.34.0
51+
cache: true
52+
environments: ${{ matrix.environment }}
53+
54+
- name: Build simple-mpc
55+
shell: bash -l {0}
56+
env:
57+
CMAKE_BUILD_PARALLEL_LEVEL: 4
58+
SIMPLE_MPC_BUILD_TYPE: ${{ matrix.build_type }}
59+
run: |
60+
pixi run -e ${{ matrix.environment }} test
61+
62+
check:
63+
if: always()
64+
name: check-macos-linux-pixi
65+
66+
needs:
67+
- simple-mpc-pixi
68+
69+
runs-on: ubuntu-latest
70+
71+
steps:
72+
- name: Decide whether the needed jobs succeeded or failed
73+
uses: re-actors/alls-green@release/v1
74+
with:
75+
jobs: ${{ toJSON(needs) }}

pixi.toml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[project]
2+
name = "simple-mpc"
3+
version = "0.1"
4+
channels = ["conda-forge"]
5+
description = "MPC schemes for locomotion"
6+
platforms = ["linux-64", "osx-arm64"]
7+
license = "BSD-2-Clause"
8+
license-file = "LICENSE"
9+
readme = "README.md"
10+
11+
[build-dependencies]
12+
ccache = ">=4.9.1"
13+
cmake = ">=3.10"
14+
cxx-compiler = ">=1.7.0"
15+
ninja = ">=1.11"
16+
pkg-config = ">=0.29.2"
17+
18+
[dependencies]
19+
libboost-python-devel = ">=1.80.0"
20+
python = "3.11"
21+
eigenpy = ">=3.10.1"
22+
aligator = ">=0.10"
23+
benchmark = ">=1.8.0"
24+
pytest = ">=8.3.0"
25+
matplotlib = ">=3.9"
26+
27+
[activation]
28+
scripts = ["build_scripts/pixi/activation.sh"]
29+
30+
[tasks]
31+
# We must avoid to set CMAKE_CXX_FLAGS because of WIN32
32+
# https://discourse.cmake.org/t/strictly-appending-to-cmake-lang-flags/6478
33+
configure = { cmd = [
34+
"CXXFLAGS=$ALIGATOR_CXX_FLAGS",
35+
"cmake",
36+
"-G",
37+
"Ninja",
38+
"-B",
39+
"build",
40+
"-S",
41+
".",
42+
"-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX",
43+
"-DCMAKE_BUILD_TYPE=$SIMPLE_MPC_BUILD_TYPE",
44+
"-DBUILD_TESTING=ON",
45+
"-DGENERATE_PYTHON_STUBS=ON",
46+
] }
47+
build = { cmd = "cmake --build build --target all", depends_on = ["configure"] }
48+
clean = { cmd = "rm -rf build" }
49+
test = { cmd = "ctest --test-dir build --output-on-failure", depends_on = [
50+
"build",
51+
] }
52+
53+
[feature.lint]
54+
dependencies = { pre-commit = ">=3.6.2" }
55+
tasks = { lint = { cmd = "pre-commit run --all" } }
56+
57+
[feature.py311.dependencies]
58+
python = "3.11.*"
59+
60+
# Use clang on GNU/Linux.
61+
# We must use scripts instead of env to setup CC and CXX
62+
# to avoid cxx-compiler to overwrite them.
63+
[feature.clang]
64+
platforms = ["linux-64"]
65+
activation = { scripts = ["build_scripts/pixi/activation_clang.sh"] }
66+
dependencies = { clangxx = "*" }
67+
68+
[environments]
69+
default = { features = ["py311"], solve-group = "py311" }
70+
clang = { features = ["clang", "py311"] }
71+
lint = { features = ["lint"], solve-group = "py311" }
72+
all = { features = [], solve-group = "py311" }

0 commit comments

Comments
 (0)