Repository navigation
322 lines (289 loc) · 10.6 KB
/
Copy pathci-cell.yml
File metadata and controls
322 lines (289 loc) · 10.6 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
317
318
319
320
321
322
#
# Created: 13th October 2026
# Updated: 13th October 2026
#
name: CI cell
on:
workflow_call:
inputs:
cell-id:
required: true
type: string
os:
required: true
type: string
c-compiler:
required: true
type: string
cpp-compiler:
required: true
type: string
build-type:
required: false
type: string
default: Release
toolchain:
required: false
type: string
default: ''
permissions:
contents: read
jobs:
build:
name: Build (${{ inputs.cell-id }})
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- name: Install Clang (Ubuntu)
if: runner.os == 'Linux' && inputs.c-compiler == 'clang'
run: sudo apt-get update && sudo apt-get install -y clang
- name: Setup MSYS2 MinGW
id: msys2
if: runner.os == 'Windows' && inputs.toolchain == 'mingw'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
mingw-w64-x86_64-make
- name: Install test dependencies (STLSoft + xTests)
uses: ./.github/actions/install-sis-deps
with:
build-type: ${{ inputs.build-type }}
c-compiler: ${{ inputs.c-compiler }}
cpp-compiler: ${{ inputs.cpp-compiler }}
# Dependency order (deliberately not lexicographic): each package
# is configured against those already installed.
dependencies: STLSoft xTests
toolchain: ${{ inputs.toolchain }}
- name: Configure
shell: bash
run: |
set -euo pipefail
if [ "${{ inputs.c-compiler }}" = "cl" ]; then
cmake -B build -S . \
-DCMAKE_DISABLE_FIND_PACKAGE_MFC=TRUE \
-DCMAKE_PREFIX_PATH="${{ env.SIS_DEPS }}" \
-DBUILD_EXAMPLES=ON \
-DBUILD_TESTING=ON
elif [ "${{ inputs.toolchain }}" = "mingw" ]; then
export PATH="/mingw64/bin:$PATH"
cmake -B build -S . -G "MinGW Makefiles" \
-DCMAKE_BUILD_TYPE="${{ inputs.build-type }}" \
-DCMAKE_C_COMPILER="${{ inputs.c-compiler }}" \
-DCMAKE_CXX_COMPILER="${{ inputs.cpp-compiler }}" \
-DCMAKE_PREFIX_PATH="${{ env.SIS_DEPS }}" \
-DBUILD_EXAMPLES=ON \
-DBUILD_TESTING=ON
else
cmake -B build -S . \
-DCMAKE_BUILD_TYPE="${{ inputs.build-type }}" \
-DCMAKE_C_COMPILER="${{ inputs.c-compiler }}" \
-DCMAKE_CXX_COMPILER="${{ inputs.cpp-compiler }}" \
-DCMAKE_PREFIX_PATH="${{ env.SIS_DEPS }}" \
-DBUILD_EXAMPLES=ON \
-DBUILD_TESTING=ON
fi
- name: Build
shell: bash
run: |
set -euo pipefail
if [ "${{ inputs.c-compiler }}" = "cl" ]; then
cmake --build build --config "${{ inputs.build-type }}" --parallel
elif [ "${{ inputs.toolchain }}" = "mingw" ]; then
export PATH="/mingw64/bin:$PATH"
cmake --build build --parallel 2
else
cmake --build build --parallel
fi
- name: Test (CTest)
shell: bash
run: |
set -euo pipefail
if [ "${{ inputs.toolchain }}" = "mingw" ]; then
export PATH="/mingw64/bin:$PATH"
fi
ctest --test-dir build --output-on-failure \
--build-config "${{ inputs.build-type }}" --timeout 60 \
--no-tests=error
- name: Upload build tree
uses: actions/upload-artifact@v4
with:
name: sis-build-${{ inputs.cell-id }}
path: build
retention-days: 1
# Windows cells dogfood the native .cmd runners (never the .sh); every
# other cell uses the Bash runners. download-artifact strips execute bits.
run-examples:
name: Examples (${{ inputs.cell-id }})
needs: build
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- name: Setup MSYS2 MinGW
id: msys2
if: runner.os == 'Windows' && inputs.toolchain == 'mingw'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: mingw-w64-x86_64-toolchain
- name: Download build tree
uses: actions/download-artifact@v4
with:
name: sis-build-${{ inputs.cell-id }}
path: build
# download-artifact does not restore Unix execute bits;
# run_all_*.sh discovery requires -perm -100 (or *.exe on Windows).
# Skip CMakeFiles and compiler deps — name globs also match
# e.g. test.unit.*.c.o.d / example*.cpp.o.d; chmod +x on those
# makes tip runners treat them as programs (exit 127).
- name: Restore execute bits on test and example binaries
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
find build -type f \
! -path '*/CMakeFiles/*' \
! -name '*.d' \
! -name '*.o' \
! -name '*.obj' \
\( \
-name 'test_unit*' -o -name 'test.unit.*' -o \
-name 'test_component*' -o -name 'test.component.*' -o \
-name 'test_performance*' -o -name 'test.performance.*' -o \
-name 'test_scratch*' -o -name 'test.scratch.*' -o \
\( -name 'example*' ! -name '*.md' \) \
\) -exec chmod +x {} +
- name: Run examples (Bash)
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
SIS_CMAKE_BUILD_DIR="${{ github.workspace }}/build" ./run_all_examples.sh -M
- name: Run examples (native cmd)
if: runner.os == 'Windows'
shell: cmd
env:
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
SIS_CMAKE_BUILD_DIR: ${{ github.workspace }}\build
run: |
if "${{ inputs.toolchain }}"=="mingw" set "PATH=%MSYS2_LOCATION%\mingw64\bin;%PATH%"
call run_all_examples.cmd
if errorlevel 1 exit /b 1
test-unit:
name: Unit tests (${{ inputs.cell-id }})
needs: build
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- name: Setup MSYS2 MinGW
id: msys2
if: runner.os == 'Windows' && inputs.toolchain == 'mingw'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: mingw-w64-x86_64-toolchain
- name: Download build tree
uses: actions/download-artifact@v4
with:
name: sis-build-${{ inputs.cell-id }}
path: build
# download-artifact does not restore Unix execute bits;
# run_all_*.sh discovery requires -perm -100 (or *.exe on Windows).
# Skip CMakeFiles and compiler deps — name globs also match
# e.g. test.unit.*.c.o.d / example*.cpp.o.d; chmod +x on those
# makes tip runners treat them as programs (exit 127).
- name: Restore execute bits on test and example binaries
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
find build -type f \
! -path '*/CMakeFiles/*' \
! -name '*.d' \
! -name '*.o' \
! -name '*.obj' \
\( \
-name 'test_unit*' -o -name 'test.unit.*' -o \
-name 'test_component*' -o -name 'test.component.*' -o \
-name 'test_performance*' -o -name 'test.performance.*' -o \
-name 'test_scratch*' -o -name 'test.scratch.*' -o \
\( -name 'example*' ! -name '*.md' \) \
\) -exec chmod +x {} +
- name: Run unit tests (Bash)
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
SIS_CMAKE_BUILD_DIR="${{ github.workspace }}/build" ./run_all_unit_tests.sh -M --unit-only
- name: Run unit tests (native cmd)
if: runner.os == 'Windows'
shell: cmd
env:
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
SIS_CMAKE_BUILD_DIR: ${{ github.workspace }}\build
run: |
if "${{ inputs.toolchain }}"=="mingw" set "PATH=%MSYS2_LOCATION%\mingw64\bin;%PATH%"
call run_all_unit_tests.cmd --unit-only
if errorlevel 1 exit /b 1
test-scratch:
name: Scratch tests (${{ inputs.cell-id }})
needs: build
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- name: Setup MSYS2 MinGW
id: msys2
if: runner.os == 'Windows' && inputs.toolchain == 'mingw'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: mingw-w64-x86_64-toolchain
- name: Download build tree
uses: actions/download-artifact@v4
with:
name: sis-build-${{ inputs.cell-id }}
path: build
# download-artifact does not restore Unix execute bits;
# run_all_*.sh discovery requires -perm -100 (or *.exe on Windows).
# Skip CMakeFiles and compiler deps — name globs also match
# e.g. test.unit.*.c.o.d / example*.cpp.o.d; chmod +x on those
# makes tip runners treat them as programs (exit 127).
- name: Restore execute bits on test and example binaries
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
find build -type f \
! -path '*/CMakeFiles/*' \
! -name '*.d' \
! -name '*.o' \
! -name '*.obj' \
\( \
-name 'test_unit*' -o -name 'test.unit.*' -o \
-name 'test_component*' -o -name 'test.component.*' -o \
-name 'test_performance*' -o -name 'test.performance.*' -o \
-name 'test_scratch*' -o -name 'test.scratch.*' -o \
\( -name 'example*' ! -name '*.md' \) \
\) -exec chmod +x {} +
- name: Run scratch tests (Bash)
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
SIS_CMAKE_BUILD_DIR="${{ github.workspace }}/build" ./run_all_scratch_tests.sh -M
- name: Run scratch tests (native cmd)
if: runner.os == 'Windows'
shell: cmd
env:
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
SIS_CMAKE_BUILD_DIR: ${{ github.workspace }}\build
run: |
if "${{ inputs.toolchain }}"=="mingw" set "PATH=%MSYS2_LOCATION%\mingw64\bin;%PATH%"
call run_all_scratch_tests.cmd
if errorlevel 1 exit /b 1