1
1
name : Reusable SYCL Linux build workflow
2
2
3
+ defaults :
4
+ run :
5
+ shell : bash
6
+
3
7
on :
4
8
workflow_call :
5
9
inputs :
29
33
type : string
30
34
required : false
31
35
default : " --hip --cuda --native_cpu"
32
- build_artifact_suffix :
33
- type : string
34
- required : true
35
36
build_target :
36
37
type : string
37
38
required : false
38
39
default : sycl-toolchain
39
- artifact_archive_name :
40
- type : string
41
- default : llvm_sycl.tar.zst
40
+
42
41
changes :
43
42
type : string
44
43
description : ' Filter matches for the changed files in the PR'
45
- default : ' [llvm, clang, sycl, llvm_spirv, xptifw, libclc, libdevice ]'
44
+ default : ' [llvm, clang, sycl, llvm_spirv, xptifw, libclc]'
46
45
required : false
46
+
47
+ # Artifacts:
48
+
47
49
retention-days :
48
50
description : ' Artifacts retention period'
49
51
type : string
50
52
default : 3
53
+
54
+ toolchain_artifact :
55
+ type : string
56
+ required : true
57
+ toolchain_artifact_filename :
58
+ type : string
59
+ default : llvm_sycl.tar.zst
60
+
61
+ release_toolchain_artifact :
62
+ type : string
63
+ required : false
64
+ description : |
65
+ If provided, create an additional toolchain artifact without utilities
66
+ used for testing in it. File name of the archive is the same as in the
67
+ `toolchain_artifact` above.
68
+
51
69
e2e_binaries_artifact :
52
70
type : string
53
71
required : false
54
- pack_release :
72
+ e2e_binaries_spirv_backend_artifact :
73
+ type : string
74
+ required : false
75
+ e2e_binaries_preview_artifact :
55
76
type : string
56
77
required : false
57
78
58
79
outputs :
59
80
build_conclusion :
60
81
value : ${{ jobs.build.outputs.build_conclusion }}
61
- artifact_archive_name :
62
- value : ${{ jobs.build.outputs.artifact_archive_name }}
63
- artifact_decompress_command :
64
- value : ${{ jobs.build.outputs.artifact_decompress_command }}
82
+ toolchain_artifact :
83
+ value : ${{ inputs.toolchain_artifact }}
84
+ toolchain_artifact_filename :
85
+ value : ${{ jobs.build.outputs.toolchain_artifact_filename }}
86
+ toolchain_decompress_command :
87
+ value : ${{ jobs.build.outputs.toolchain_decompress_command }}
65
88
66
89
workflow_dispatch :
67
90
inputs :
70
93
type : choice
71
94
options :
72
95
- " []"
73
- - ' [llvm, clang, sycl, llvm_spirv, xptifw, libclc, libdevice ]'
96
+ - ' [llvm, clang, sycl, llvm_spirv, xptifw, libclc]'
74
97
build_image :
75
98
type : choice
76
99
options :
98
121
options :
99
122
- " default"
100
123
101
- build_artifact_suffix :
102
- type : choice
103
- options :
104
- - " default"
105
124
retention-days :
106
125
type : choice
107
126
options :
108
127
- 3
109
128
110
- pack_release :
111
- type : string
112
- required : false
129
+ toolchain_artifact :
130
+ type : choice
131
+ options :
132
+ - " sycl_linux_default"
113
133
114
134
permissions : read-all
115
135
@@ -122,8 +142,8 @@ jobs:
122
142
options : -u 1001:1001
123
143
outputs :
124
144
build_conclusion : ${{ steps.build.conclusion }}
125
- artifact_archive_name : ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
126
- artifact_decompress_command : ${{ steps.artifact_info.outputs.DECOMPRESS }}
145
+ toolchain_artifact_filename : ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
146
+ toolchain_decompress_command : ${{ steps.artifact_info.outputs.DECOMPRESS }}
127
147
env :
128
148
CCACHE_DIR : ${{ inputs.build_cache_root }}/build_cache_${{ inputs.build_cache_suffix }}
129
149
CCACHE_MAXSIZE : 8G
@@ -132,7 +152,7 @@ jobs:
132
152
# To reduce number of inputs parameters that is limited for manual triggers.
133
153
id : artifact_info
134
154
run : |
135
- NAME="${{inputs.artifact_archive_name }}"
155
+ NAME="${{inputs.toolchain_artifact_filename }}"
136
156
if [ -z "$NAME" ]; then
137
157
NAME=llvm_sycl.tar.zst
138
158
fi
@@ -163,6 +183,10 @@ jobs:
163
183
if : ${{ inputs.cc == 'icx' || inputs.cxx == 'icpx' }}
164
184
uses : ./devops/actions/setup_linux_oneapi_env
165
185
- name : Configure
186
+ # Setting `CMAKE_INSTALL_PREFIX` is important because that's the location
187
+ # where `sycl-linux-run-tests.yml` unpacks the toolchain to. That location
188
+ # *must* match between build-only and run-only E2E tests runs and we might
189
+ # be creating pre-built E2E tests' binaries in this workflow.
166
190
env :
167
191
CC : ${{ inputs.cc }}
168
192
CXX : ${{ inputs.cxx }}
@@ -172,26 +196,42 @@ jobs:
172
196
mkdir -p $GITHUB_WORKSPACE/build
173
197
cd $GITHUB_WORKSPACE/build
174
198
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
175
- -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
199
+ -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build \
200
+ -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/toolchain \
201
+ -t Release \
176
202
--ci-defaults ${{ inputs.build_configure_extra_args }} \
177
203
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
178
204
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
179
205
-DLLVM_INSTALL_UTILS=ON \
180
- -DNATIVECPU_USE_OCK=Off \
181
- -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV
206
+ -DNATIVECPU_USE_OCK=Off
182
207
- name : Compile
183
208
id : build
184
209
# Emulate default value for manual dispatch as we've run out of available arguments.
185
210
run : cmake --build $GITHUB_WORKSPACE/build --target ${{ inputs.build_target || 'sycl-toolchain' }}
186
211
- name : check-llvm
187
212
if : always() && !cancelled() && contains(inputs.changes, 'llvm')
213
+ env :
214
+ # Can't inline to support possible quotes inside:
215
+ BUILD_CONFIGURE_EXTRA_ARGS : ${{ inputs.build_configure_extra_args }}
188
216
run : |
217
+ if [[ "${BUILD_CONFIGURE_EXTRA_ARGS}" == *"--use-libcxx"* ]]; then
218
+ # https://github.com/llvm/llvm-project/issues/59429
219
+ export LIT_FILTER_OUT="ExecutionEngine/MCJIT"
220
+ fi
221
+
189
222
cmake --build $GITHUB_WORKSPACE/build --target check-llvm
190
223
- name : check-clang
191
224
if : always() && !cancelled() && contains(inputs.changes, 'clang')
225
+ env :
226
+ # Can't inline to support possible quotes inside:
227
+ BUILD_CONFIGURE_EXTRA_ARGS : ${{ inputs.build_configure_extra_args }}
192
228
run : |
193
229
# Can we move this to Dockerfile? Hopefully, noop on Windows.
194
230
export XDG_CACHE_HOME=$GITHUB_WORKSPACE/os_cache
231
+ if [[ "${BUILD_CONFIGURE_EXTRA_ARGS}" == *"--use-libcxx"* ]]; then
232
+ # https://github.com/llvm/llvm-project/issues/59428
233
+ export LIT_FILTER_OUT="(E|e)xception"
234
+ fi
195
235
cmake --build $GITHUB_WORKSPACE/build --target check-clang
196
236
- name : check-sycl
197
237
if : always() && !cancelled() && contains(inputs.changes, 'sycl')
@@ -218,7 +258,7 @@ jobs:
218
258
run : |
219
259
cmake --build $GITHUB_WORKSPACE/build --target check-libclc
220
260
- name : check-libdevice
221
- if : always() && !cancelled() && contains(inputs.changes, 'libdevice ')
261
+ if : always() && !cancelled() && contains(inputs.changes, 'sycl ')
222
262
run : |
223
263
cmake --build $GITHUB_WORKSPACE/build --target check-libdevice
224
264
- name : Check E2E test requirements
@@ -233,13 +273,13 @@ jobs:
233
273
cmake --build $GITHUB_WORKSPACE/build --target deploy-sycl-toolchain
234
274
235
275
- name : Pack toolchain release
236
- if : ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true ' }}
237
- run : tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/build/install .
276
+ if : ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.release_toolchain_artifact != ' ' }}
277
+ run : tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/toolchain .
238
278
- name : Upload toolchain release
239
- if : ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true ' }}
279
+ if : ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.release_toolchain_artifact != ' ' }}
240
280
uses : actions/upload-artifact@v4
241
281
with :
242
- name : sycl_linux_release
282
+ name : ${{ inputs.release_toolchain_artifact }}
243
283
path : ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
244
284
retention-days : ${{ inputs.retention-days }}
245
285
@@ -264,24 +304,20 @@ jobs:
264
304
265
305
- name : Pack toolchain
266
306
if : ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
267
- run : tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/build/install .
307
+ run : tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/toolchain .
268
308
- name : Upload toolchain
269
309
if : ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
270
310
uses : actions/upload-artifact@v4
271
311
with :
272
- name : sycl_linux_ ${{ inputs.build_artifact_suffix }}
312
+ name : ${{ inputs.toolchain_artifact }}
273
313
path : ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
274
314
retention-days : ${{ inputs.retention-days }}
275
315
276
- - name : Copy toolchain
277
- if : ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
278
- # We must have the compiler in the same location as it will be in the E2E
279
- # run-tests job.
280
- run : cp -r $GITHUB_WORKSPACE/build/install $GITHUB_WORKSPACE/toolchain
281
316
282
317
- name : Source OneAPI TBB vars.sh
283
- if : ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
284
- shell : bash
318
+ # Tasks that use the just built toolchain below, need extra environment
319
+ # setup. No harm in it if all of those tasks would get skipped.
320
+ if : ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
285
321
run : |
286
322
# https://github.com/actions/runner/issues/1964 prevents us from using
287
323
# the ENTRYPOINT in the image.
@@ -309,31 +345,31 @@ jobs:
309
345
extra_lit_opts : --param sycl_build_targets="spir;nvidia;amd"
310
346
311
347
- name : Remove E2E tests before spirv-backend run
312
- if : ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
348
+ if : ${{ inputs.e2e_binaries_spirv_backend_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
313
349
run : rm -rf build-e2e
314
350
315
351
- name : Build E2E tests with SPIR-V Backend
316
- if : ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
352
+ if : ${{ inputs.e2e_binaries_spirv_backend_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
317
353
uses : ./devops/actions/run-tests/e2e
318
354
with :
319
355
ref : ${{ inputs.ref || github.sha }}
320
356
testing_mode : build-only
321
357
target_devices : all
322
- binaries_artifact : ${{ inputs.e2e_binaries_artifact }}_spirv_backend
358
+ binaries_artifact : ${{ inputs.e2e_binaries_spirv_backend_artifact }}
323
359
sycl_compiler : $GITHUB_WORKSPACE/toolchain/bin/clang++
324
360
extra_lit_opts : --param spirv-backend=True
325
361
326
362
- name : Remove E2E tests before preview-mode run
327
- if : ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
363
+ if : ${{ inputs.e2e_binaries_preview_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
328
364
run : rm -rf build-e2e
329
365
330
366
- name : Build E2E tests in Preview Mode
331
- if : ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
367
+ if : ${{ inputs.e2e_binaries_preview_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
332
368
uses : ./devops/actions/run-tests/e2e
333
369
with :
334
370
ref : ${{ inputs.ref || github.sha }}
335
371
testing_mode : build-only
336
372
target_devices : all
337
- binaries_artifact : ${{ inputs.e2e_binaries_artifact }}_preview
373
+ binaries_artifact : ${{ inputs.e2e_binaries_preview_artifact }}
338
374
sycl_compiler : $GITHUB_WORKSPACE/toolchain/bin/clang++
339
375
extra_lit_opts : --param test-preview-mode=True
0 commit comments