-
Notifications
You must be signed in to change notification settings - Fork 557
316 lines (275 loc) · 10.3 KB
/
Copy pathmacos-linux-windows-pixi.yml
File metadata and controls
316 lines (275 loc) · 10.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
name: CI - MacOS/Linux/Windows via Pixi
on:
schedule:
- cron: "0 0 * * 1"
push:
branches:
- devel
paths-ignore:
- doc/**
- .gitlab-ci.yml
- .gitignore
- "**.md"
- CITATION.*
- COPYING.LESSER
- colcon.pkg
- .pre-commit-config.yaml
pull_request:
paths-ignore:
- doc/**
- .gitlab-ci.yml
- .gitignore
- "**.md"
- CITATION.*
- COPYING.LESSER
- colcon.pkg
- .pre-commit-config.yaml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# This is needed on Windows because ellipsoid-joint-kinematics.py output
# some utf8 char.
# More detail here: https://gist.github.com/NodeJSmith/e7e37f2d3f162456869f015f842bcf15
PYTHONIOENCODING: "utf8"
jobs:
pinocchio-pixi:
name: Standard - ${{ matrix.os }} - Env ${{ matrix.environment }} ${{ matrix.build_type }} ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
env:
CCACHE_BASEDIR: ${GITHUB_WORKSPACE}
CCACHE_DIR: ${GITHUB_WORKSPACE}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 5
# Since pixi will install a compiler, the compiler mtime will be changed.
# This can invalidate the cache (https://ccache.dev/manual/latest.html#config_compiler_check)
CCACHE_COMPILERCHECK: content
BUILD_ADVANCED_TESTING: ${{ matrix.BUILD_ADVANCED_TESTING }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-15-intel]
environment: [all, all-python-oldest]
build_type: [Release, Debug]
include:
# Disable BUILD_ADVANCED_TESTING as the test can take many time to run
- os: ubuntu-latest
BUILD_ADVANCED_TESTING: OFF
- os: ubuntu-24.04-arm
BUILD_ADVANCED_TESTING: OFF
- os: macos-latest
BUILD_ADVANCED_TESTING: OFF
- os: macos-15-intel
BUILD_ADVANCED_TESTING: OFF
- os: windows-2022
environment: all
build_type: Release
BUILD_ADVANCED_TESTING: OFF
- os: windows-2022
environment: all-clang-cl
build_type: Release
BUILD_ADVANCED_TESTING: OFF
steps:
# extract branch name or checkout devel branch for scheduled events
- name: Get branch name or checkout devel
shell: bash -el {0}
run: |
if [ "${{ github.event_name }}" == "schedule" ]; then
echo "BRANCH_NAME=devel" >> $GITHUB_ENV
echo "LABELS=build_all" >> $GITHUB_ENV
else
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
fi
- uses: actions/checkout@v7
with:
ref: ${{ env.BRANCH_NAME }}
submodules: recursive
- uses: actions/cache@v6
with:
path: .ccache
key: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.environment }}_${{ github.sha }}
restore-keys: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.environment }}_
- uses: prefix-dev/setup-pixi@v0.10.0
with:
cache: true
environments: ${{ matrix.environment }}
# Avoid filling all disk space with debug symbols
- name: Setup CMAKE_TOOLCHAIN_FILE
if: (contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')) && contains(matrix.build_type, 'Debug')
run: |
echo "CMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/.github/workflows/cmake/linux-debug-toolchain.cmake" >> "$GITHUB_ENV"
- name: Get Compilation Flags
id: get_labels
uses: actions/github-script@v9
env:
LABELS: ${{ env.LABELS }}
with:
script: |
const script = require('./.github/workflows/scripts/get_compilation_flags.js');
await script({github, context, core})
result-encoding: string
- name: Clear ccache statistics [MacOS/Linux/Windows]
run: |
pixi run -e ${{ matrix.environment }} ccache -z
- name: Build Pinocchio [MacOS/Linux/Windows]
shell: bash -el {0}
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
PINOCCHIO_BUILD_TYPE: ${{ matrix.build_type }}
run: |
# Launch configure but overwrite default options
pixi run -e ${{ matrix.environment }} configure \
-DBUILD_ADVANCED_TESTING=${{ env.BUILD_ADVANCED_TESTING }} \
${{ steps.get_labels.outputs.cmakeFlags }}
pixi run -e ${{ matrix.environment }} cmake --build build --target all
pixi run -e ${{ matrix.environment }} ctest --test-dir build --output-on-failure
pixi run -e ${{ matrix.environment }} cmake --install build
- name: Uninstall Pinocchio
shell: bash -el {0}
run: |
pixi run -e ${{ matrix.environment }} cmake --build build --target uninstall
- name: Display ccache statistics
shell: bash -el {0}
run: |
pixi run -e ${{ matrix.environment }} ccache -sv
pinocchio-python-standalone-pixi:
name: Python standalone - ${{ matrix.os }} - Env ${{ matrix.environment }}
runs-on: ${{ matrix.os }}
env:
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.
# This can invalidate the cache (https://ccache.dev/manual/latest.html#config_compiler_check)
CCACHE_COMPILERCHECK: content
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-15-intel, windows-2022]
environment: [all]
steps:
# extract branch name or checkout devel branch for scheduled events
- name: Get branch name or checkout devel
shell: bash -el {0}
run: |
if [ "${{ github.event_name }}" == "schedule" ]; then
echo "BRANCH_NAME=devel" >> $GITHUB_ENV
echo "LABELS=build_all" >> $GITHUB_ENV
else
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
fi
- uses: actions/checkout@v7
with:
ref: ${{ env.BRANCH_NAME }}
submodules: recursive
- uses: actions/cache@v6
with:
path: .ccache
key: ccache-python-standalone-macos-linux-conda-${{ matrix.os }}-${{ matrix.environment }}_${{ github.sha }}
restore-keys: ccache-python-standalone-macos-linux-conda-${{ matrix.os }}-${{ matrix.environment }}_
- uses: prefix-dev/setup-pixi@v0.10.0
with:
cache: true
environments: ${{ matrix.environment }}
- name: Get Compilation Flags
id: get_labels
uses: actions/github-script@v9
env:
LABELS: ${{ env.LABELS }}
with:
script: |
const script = require('./.github/workflows/scripts/get_compilation_flags.js');
await script({github, context, core})
result-encoding: string
- name: Clear ccache statistics [MacOS/Linux/Windows]
run: |
pixi run -e ${{ matrix.environment }} ccache -z
# Following steps will modify the pixi environment
- name: Build Pinocchio cpp [MacOS/Linux/Windows]
shell: bash -el {0}
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
PINOCCHIO_BUILD_TYPE: ${{ matrix.build_type }}
run: |
pixi run -e ${{ matrix.environment }} configure \
-B build_cpp \
-DBUILD_PYTHON_INTERFACE=OFF \
${{ steps.get_labels.outputs.cmakeFlags }}
pixi run -e ${{ matrix.environment }} cmake --build build_cpp --target all
pixi run -e ${{ matrix.environment }} cmake --install build_cpp
pixi run -e ${{ matrix.environment }} ctest --test-dir build_cpp --output-on-failure
- name: Build Pinocchio standalone python [MacOS/Linux/Windows]
shell: bash -el {0}
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
PINOCCHIO_BUILD_TYPE: ${{ matrix.build_type }}
run: |
pixi run -e ${{ matrix.environment }} configure \
-DBUILD_PYTHON_INTERFACE=ON \
-DBUILD_STANDALONE_PYTHON_INTERFACE=ON \
-B build_python \
${{ steps.get_labels.outputs.cmakeFlags }}
pixi run -e ${{ matrix.environment }} cmake --build build_python --target all
pixi run -e ${{ matrix.environment }} cmake --install build_python
pixi run -e ${{ matrix.environment }} ctest --test-dir build_python --output-on-failure
- name: Display ccache statistics
shell: bash -el {0}
run: |
pixi run -e ${{ matrix.environment }} ccache -sv
# pinocchio-pixi-build:
# name: Pixi build - ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest, macos-latest, macos-15-intel, windows-2022]
# steps:
# - uses: actions/checkout@v7
# with:
# submodules: recursive
# - uses: prefix-dev/setup-pixi@v0.10.0
# env:
# CMAKE_BUILD_PARALLEL_LEVEL: 2
# with:
# cache: true
# environments: test-pixi-build
# - name: Test package [MacOS/Linux/Windows]
# run: |
# pixi run -e test-pixi-build test
pinocchio-rtsan-build:
name: RTSan build - ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: Ubuntu (x86_64)
- os: macos-latest
name: MacOS (ARM64)
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- uses: prefix-dev/setup-pixi@v0.10.0
with:
cache: true
- name: Build with RTSan
run: pixi run -e sanitizers build
- name: Test with RTSan
run: pixi run -e sanitizers test
check:
if: always()
name: check-macos-linux-windows-pixi
needs:
- pinocchio-pixi
- pinocchio-python-standalone-pixi
# - pinocchio-pixi-build
- pinocchio-rtsan-build
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) }}