@@ -64,10 +64,11 @@ jobs:
64
64
65
65
devcontainer :
66
66
needs : determine-version
67
- name : Ubuntu dev container/${{ matrix.cmake_build_type }}
67
+ name : Ubuntu dev container/${{ matrix.cmake_build_type }}/${{ matrix.build_system }}
68
68
strategy :
69
69
fail-fast : false
70
70
matrix :
71
+ build_system : [cmake, spm]
71
72
spm_configuration : [debug, release]
72
73
include :
73
74
- spm_configuration : debug
96
97
push : never
97
98
98
99
- name : Build and Test via CMake
100
+ if : ${{ matrix.build_system == 'cmake' }}
99
101
uses :
devcontainers/[email protected]
100
102
env :
101
103
HYLO_LLVM_BUILD_TYPE : ${{ matrix.HYLO_LLVM_BUILD_TYPE }}
@@ -115,10 +117,8 @@ jobs:
115
117
ctest --output-on-failure --parallel --test-dir .ninja-build
116
118
push : never
117
119
118
- - name : Reclaim disk space
119
- run : rm -rf .ninja-build
120
-
121
120
- name : Restore Cache for SPM
121
+ if : ${{ matrix.build_system == 'spm' }}
122
122
uses : actions/cache@v4
123
123
with :
124
124
path : .build
@@ -127,6 +127,7 @@ jobs:
127
127
${{ runner.os }}-spm-
128
128
129
129
- name : Build and Test via SPM
130
+ if : ${{ matrix.build_system == 'spm' }}
130
131
uses :
devcontainers/[email protected]
131
132
with :
132
133
runCmd : |
@@ -136,7 +137,7 @@ jobs:
136
137
137
138
- name : Export Coverage
138
139
uses :
devcontainers/[email protected]
139
- if : ${{ contains(matrix.more-spm-test-options, '--enable-code-coverage') }}
140
+ if : ${{ matrix.build_system == 'spm' && contains(matrix.more-spm-test-options, '--enable-code-coverage') }}
140
141
with :
141
142
runCmd : |
142
143
shopt -s nullglob
@@ -150,7 +151,7 @@ jobs:
150
151
push : never
151
152
152
153
- name : Upload coverage reports to Codecov
153
- if : ${{ contains(matrix.more-spm-test-options, '--enable-code-coverage') }}
154
+ if : ${{ matrix.build_system == 'spm' && contains(matrix.more-spm-test-options, '--enable-code-coverage') }}
154
155
155
156
with :
156
157
token : ${{ secrets.CODECOV_TOKEN }}
@@ -164,20 +165,23 @@ jobs:
164
165
165
166
native :
166
167
needs : determine-version
167
- name : " Native: ${{ matrix.os }}/${{ matrix.spm_configuration }}/${{ matrix.cmake_generator }}"
168
+ name : " Native: ${{ matrix.os }}/${{ matrix.spm_configuration }}/${{ matrix.build_system }}/${{ matrix. cmake_generator }}"
168
169
strategy :
169
170
fail-fast : false
170
171
matrix :
171
172
# macos-latest is apparently not the latest.
172
173
os : [macos-13, ubuntu-latest, windows-latest]
173
174
spm_configuration : [debug, release]
174
175
cmake_generator : [Ninja, Xcode]
176
+ build_system : [cmake, spm]
175
177
176
178
exclude :
177
179
- os : ubuntu-latest
178
180
cmake_generator : Xcode
179
181
- os : windows-latest
180
182
cmake_generator : Xcode
183
+ - build_system : spm
184
+ cmake_generator : Ninja
181
185
182
186
include :
183
187
- HYLO_LLVM_BUILD_RELEASE : 20240303-215025
@@ -272,6 +276,7 @@ jobs:
272
276
${{ matrix.unpackage_command }} ${{ env.llvm_package_basename }}${{ matrix.llvm_package_suffix }}
273
277
274
278
- name : Configure (CMake)
279
+ if : ${{ matrix.build_system == 'cmake' }}
275
280
# We explicitly point to swiftc in the PATH because otherwise CMake picks up the one in XCode.
276
281
run : >-
277
282
cmake -G '${{ matrix.cmake_generator }}' -S . -B .ninja-build
@@ -282,12 +287,14 @@ jobs:
282
287
working-directory : hylo
283
288
284
289
- name : Build (CMake)
290
+ if : ${{ matrix.build_system == 'cmake' }}
285
291
run : cmake --build hylo/.ninja-build ${{ matrix.cmake_generator == 'Xcode' && format('--config {0}', matrix.cmake_build_type) || '' }}
286
292
287
293
- name : Test (CMake)
294
+ if : ${{ matrix.build_system == 'cmake' }}
288
295
run : ctest --output-on-failure --parallel --test-dir hylo/.ninja-build ${{ matrix.cmake_generator == 'Xcode' && format('-C {0}', matrix.cmake_build_type) || '' }}
289
296
290
- - if : ${{ matrix.use_spm }}
297
+ - if : ${{ matrix.build_system == 'spm' && matrix. use_spm }}
291
298
name : Create LLVM pkgconfig file and make it findable
292
299
run : >-
293
300
set -ex -o pipefail
@@ -300,7 +307,7 @@ jobs:
300
307
echo 'PKG_CONFIG_PATH=${{ github.workspace }}/pkg-config' >> "$GITHUB_ENV"
301
308
shell : bash
302
309
303
- - if : ${{ matrix.use_spm }}
310
+ - if : ${{ matrix.build_system == 'spm' && matrix. use_spm }}
304
311
uses : actions/cache@v4
305
312
name : SPM cache setup
306
313
with :
@@ -314,7 +321,7 @@ jobs:
314
321
run : clang -c ./StandardLibrary/Sources/LibC.c -o HyloLibC.lib
315
322
working-directory : hylo
316
323
317
- - if : ${{ matrix.on_windows_and_spm_works }}
324
+ - if : ${{ matrix.on_windows_and_spm_works && matrix.build_system == 'spm' }}
318
325
name : Build the dependencies of build tools
319
326
run : |
320
327
echo 'SPM_BUILD_TOOL_SUPPORT_NO_REENTRANT_BUILD=1' >> $env:GITHUB_ENV
@@ -325,15 +332,15 @@ jobs:
325
332
}
326
333
working-directory : hylo
327
334
328
- - if : ${{ matrix.use_spm }}
335
+ - if : ${{ matrix.build_system == 'spm' && matrix. use_spm }}
329
336
name : Build
330
337
run : |
331
338
swift build -c ${{ matrix.spm_configuration }} ${{ env.spm-build-options }} --build-tests
332
339
${{ matrix.windows_only }} if (-not $?) { swift build ${{ env.spm-build-options }} --target BuildToolDependencies }
333
340
334
341
working-directory : hylo
335
342
336
- - if : ${{ matrix.use_spm }}
343
+ - if : ${{ matrix.build_system == 'spm' && matrix. use_spm }}
337
344
name : Test
338
345
run : |
339
346
swift test --skip-build -c ${{ matrix.spm_configuration }} ${{ env.spm-build-options }} ${{ env.spm-test-options }}
0 commit comments