-
Notifications
You must be signed in to change notification settings - Fork 401
147 lines (130 loc) · 4.54 KB
/
macos-linux-windows-pixi.yml
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
name: CI - MacOS/Linux/Windows via Pixi
on:
schedule:
- cron: '0 0 * * 1'
push:
paths-ignore:
- doc/**
- .gitlab-ci.yml
- .gitignore
- '*.md'
- CITATION.*
- COPYING.LESSER
- colcon.pkg
- .pre-commit-config.yaml
- CHANGELOG.md
- development/*.md
pull_request:
paths-ignore:
- doc/**
- .gitlab-ci.yml
- .gitignore
- '*.md'
- CITATION.*
- COPYING.LESSER
- colcon.pkg
- .pre-commit-config.yaml
- CHANGELOG.md
- development/*.md
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pinocchio-pixi:
name: ${{ 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
BUILD_ADVANCED_TESTING: ${{ matrix.BUILD_ADVANCED_TESTING }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, macos-13]
environment: [all, all-py39]
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: macos-latest
BUILD_ADVANCED_TESTING: OFF
- os: macos-13
BUILD_ADVANCED_TESTING: OFF
- os: windows-latest
environment: all
build_type: Release
BUILD_ADVANCED_TESTING: OFF
- os: windows-latest
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@v4
with:
ref: ${{ env.BRANCH_NAME }}
submodules: recursive
- uses: actions/cache@v4
with:
path: .ccache
key: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.python-version }}-${{ github.sha }}
restore-keys: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.python-version }}-
- uses: prefix-dev/[email protected]
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@v7
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: 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: |
cmake --build build --target uninstall
check:
if: always()
name: check-macos-linux-windows-pixi
needs:
- pinocchio-pixi
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) }}