3333 type : string
3434 required : false
3535 default : " --hip --cuda --native_cpu"
36- build_artifact_suffix :
37- type : string
38- required : true
3936 build_target :
4037 type : string
4138 required : false
4239 default : sycl-toolchain
43- artifact_archive_name :
44- type : string
45- default : llvm_sycl.tar.zst
40+
4641 changes :
4742 type : string
4843 description : ' Filter matches for the changed files in the PR'
4944 default : ' [llvm, clang, sycl, llvm_spirv, xptifw, libclc]'
5045 required : false
46+
47+ # Artifacts:
48+
5149 retention-days :
5250 description : ' Artifacts retention period'
5351 type : string
5452 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+
5569 e2e_binaries_artifact :
5670 type : string
5771 required : false
58- pack_release :
72+ e2e_binaries_spirv_backend_artifact :
73+ type : string
74+ required : false
75+ e2e_binaries_preview_artifact :
5976 type : string
6077 required : false
6178
6279 outputs :
6380 build_conclusion :
6481 value : ${{ jobs.build.outputs.build_conclusion }}
65- artifact_archive_name :
66- value : ${{ jobs.build.outputs.artifact_archive_name }}
67- artifact_decompress_command :
68- 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 }}
6988
7089 workflow_dispatch :
7190 inputs :
@@ -102,18 +121,15 @@ on:
102121 options :
103122 - " default"
104123
105- build_artifact_suffix :
106- type : choice
107- options :
108- - " default"
109124 retention-days :
110125 type : choice
111126 options :
112127 - 3
113128
114- pack_release :
115- type : string
116- required : false
129+ toolchain_artifact :
130+ type : choice
131+ options :
132+ - " sycl_linux_default"
117133
118134permissions : read-all
119135
@@ -126,8 +142,8 @@ jobs:
126142 options : -u 1001:1001
127143 outputs :
128144 build_conclusion : ${{ steps.build.conclusion }}
129- artifact_archive_name : ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
130- 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 }}
131147 env :
132148 CCACHE_DIR : ${{ inputs.build_cache_root }}/build_cache_${{ inputs.build_cache_suffix }}
133149 CCACHE_MAXSIZE : 8G
@@ -136,7 +152,7 @@ jobs:
136152 # To reduce number of inputs parameters that is limited for manual triggers.
137153 id : artifact_info
138154 run : |
139- NAME="${{inputs.artifact_archive_name }}"
155+ NAME="${{inputs.toolchain_artifact_filename }}"
140156 if [ -z "$NAME" ]; then
141157 NAME=llvm_sycl.tar.zst
142158 fi
@@ -167,6 +183,10 @@ jobs:
167183 if : ${{ inputs.cc == 'icx' || inputs.cxx == 'icpx' }}
168184 uses : ./devops/actions/setup_linux_oneapi_env
169185 - 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.
170190 env :
171191 CC : ${{ inputs.cc }}
172192 CXX : ${{ inputs.cxx }}
@@ -176,7 +196,9 @@ jobs:
176196 mkdir -p $GITHUB_WORKSPACE/build
177197 cd $GITHUB_WORKSPACE/build
178198 python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
179- -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 \
180202 --ci-defaults ${{ inputs.build_configure_extra_args }} \
181203 -DCMAKE_C_COMPILER_LAUNCHER=ccache \
182204 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
@@ -188,19 +210,25 @@ jobs:
188210 run : cmake --build $GITHUB_WORKSPACE/build --target ${{ inputs.build_target || 'sycl-toolchain' }}
189211 - name : check-llvm
190212 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 }}
191216 run : |
192- if [[ "${{ inputs.build_configure_extra_args } }" == *"--use-libcxx"* ]]; then
217+ if [[ "${BUILD_CONFIGURE_EXTRA_ARGS }" == *"--use-libcxx"* ]]; then
193218 # https://github.com/llvm/llvm-project/issues/59429
194219 export LIT_FILTER_OUT="ExecutionEngine/MCJIT"
195220 fi
196221
197222 cmake --build $GITHUB_WORKSPACE/build --target check-llvm
198223 - name : check-clang
199224 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 }}
200228 run : |
201229 # Can we move this to Dockerfile? Hopefully, noop on Windows.
202230 export XDG_CACHE_HOME=$GITHUB_WORKSPACE/os_cache
203- if [[ "${{ inputs.build_configure_extra_args } }" == *"--use-libcxx"* ]]; then
231+ if [[ "${BUILD_CONFIGURE_EXTRA_ARGS }" == *"--use-libcxx"* ]]; then
204232 # https://github.com/llvm/llvm-project/issues/59428
205233 export LIT_FILTER_OUT="(E|e)xception"
206234 fi
@@ -245,13 +273,13 @@ jobs:
245273 cmake --build $GITHUB_WORKSPACE/build --target deploy-sycl-toolchain
246274
247275 - name : Pack toolchain release
248- if : ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true ' }}
249- 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 .
250278 - name : Upload toolchain release
251- if : ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true ' }}
279+ if : ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.release_toolchain_artifact != ' ' }}
252280 uses : actions/upload-artifact@v4
253281 with :
254- name : sycl_linux_release
282+ name : ${{ inputs.release_toolchain_artifact }}
255283 path : ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
256284 retention-days : ${{ inputs.retention-days }}
257285
@@ -276,23 +304,20 @@ jobs:
276304
277305 - name : Pack toolchain
278306 if : ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
279- 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 .
280308 - name : Upload toolchain
281309 if : ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
282310 uses : actions/upload-artifact@v4
283311 with :
284- name : sycl_linux_ ${{ inputs.build_artifact_suffix }}
312+ name : ${{ inputs.toolchain_artifact }}
285313 path : ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
286314 retention-days : ${{ inputs.retention-days }}
287315
288- - name : Copy toolchain
289- if : ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
290- # We must have the compiler in the same location as it will be in the E2E
291- # run-tests job.
292- run : cp -r $GITHUB_WORKSPACE/build/install $GITHUB_WORKSPACE/toolchain
293316
294317 - name : Source OneAPI TBB vars.sh
295- if : ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
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' }}
296321 run : |
297322 # https://github.com/actions/runner/issues/1964 prevents us from using
298323 # the ENTRYPOINT in the image.
@@ -320,31 +345,31 @@ jobs:
320345 extra_lit_opts : --param sycl_build_targets="spir;nvidia;amd"
321346
322347 - name : Remove E2E tests before spirv-backend run
323- 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' }}
324349 run : rm -rf build-e2e
325350
326351 - name : Build E2E tests with SPIR-V Backend
327- 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' }}
328353 uses : ./devops/actions/run-tests/e2e
329354 with :
330355 ref : ${{ inputs.ref || github.sha }}
331356 testing_mode : build-only
332357 target_devices : all
333- binaries_artifact : ${{ inputs.e2e_binaries_artifact }}_spirv_backend
358+ binaries_artifact : ${{ inputs.e2e_binaries_spirv_backend_artifact }}
334359 sycl_compiler : $GITHUB_WORKSPACE/toolchain/bin/clang++
335360 extra_lit_opts : --param spirv-backend=True
336361
337362 - name : Remove E2E tests before preview-mode run
338- if : ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
363+ if : ${{ inputs.e2e_binaries_preview_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
339364 run : rm -rf build-e2e
340365
341366 - name : Build E2E tests in Preview Mode
342- if : ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
367+ if : ${{ inputs.e2e_binaries_preview_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
343368 uses : ./devops/actions/run-tests/e2e
344369 with :
345370 ref : ${{ inputs.ref || github.sha }}
346371 testing_mode : build-only
347372 target_devices : all
348- binaries_artifact : ${{ inputs.e2e_binaries_artifact }}_preview
373+ binaries_artifact : ${{ inputs.e2e_binaries_preview_artifact }}
349374 sycl_compiler : $GITHUB_WORKSPACE/toolchain/bin/clang++
350375 extra_lit_opts : --param test-preview-mode=True
0 commit comments