Skip to content

Commit 5661e72

Browse files
[CI] Control each kind of pre-built E2E tests by its own input (#19645)
Also changed default install directory to avoid ugly copy.
1 parent 8e43f05 commit 5661e72

File tree

2 files changed

+33
-20
lines changed

2 files changed

+33
-20
lines changed

.github/workflows/sycl-linux-build.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,18 @@ on:
5757
toolchain_artifact_filename:
5858
type: string
5959
default: llvm_sycl.tar.zst
60+
61+
pack_release:
62+
type: string
63+
required: false
64+
6065
e2e_binaries_artifact:
6166
type: string
6267
required: false
63-
pack_release:
68+
e2e_binaries_spirv_backend_artifact:
69+
type: string
70+
required: false
71+
e2e_binaries_preview_artifact:
6472
type: string
6573
required: false
6674

@@ -174,6 +182,10 @@ jobs:
174182
if: ${{ inputs.cc == 'icx' || inputs.cxx == 'icpx' }}
175183
uses: ./devops/actions/setup_linux_oneapi_env
176184
- name: Configure
185+
# Setting `CMAKE_INSTALL_PREFIX` is important because that's the location
186+
# where `sycl-linux-run-tests.yml` unpacks the toolchain to. That location
187+
# *must* match between build-only and run-only E2E tests runs and we might
188+
# be creating pre-built E2E tests' binaries in this workflow.
177189
env:
178190
CC: ${{ inputs.cc }}
179191
CXX: ${{ inputs.cxx }}
@@ -183,7 +195,9 @@ jobs:
183195
mkdir -p $GITHUB_WORKSPACE/build
184196
cd $GITHUB_WORKSPACE/build
185197
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
186-
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
198+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build \
199+
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/toolchain \
200+
-t Release \
187201
--ci-defaults ${{ inputs.build_configure_extra_args }} \
188202
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
189203
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
@@ -259,7 +273,7 @@ jobs:
259273
260274
- name: Pack toolchain release
261275
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true' }}
262-
run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/build/install .
276+
run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/toolchain .
263277
- name: Upload toolchain release
264278
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true' }}
265279
uses: actions/upload-artifact@v4
@@ -289,7 +303,7 @@ jobs:
289303
290304
- name: Pack toolchain
291305
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
292-
run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/build/install .
306+
run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/toolchain .
293307
- name: Upload toolchain
294308
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
295309
uses: actions/upload-artifact@v4
@@ -298,14 +312,11 @@ jobs:
298312
path: ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
299313
retention-days: ${{ inputs.retention-days }}
300314

301-
- name: Copy toolchain
302-
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
303-
# We must have the compiler in the same location as it will be in the E2E
304-
# run-tests job.
305-
run: cp -r $GITHUB_WORKSPACE/build/install $GITHUB_WORKSPACE/toolchain
306315

307316
- name: Source OneAPI TBB vars.sh
308-
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
317+
# Tasks that use the just built toolchain below, need extra environment
318+
# setup. No harm in it if all of those tasks would get skipped.
319+
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
309320
run: |
310321
# https://github.com/actions/runner/issues/1964 prevents us from using
311322
# the ENTRYPOINT in the image.
@@ -333,31 +344,31 @@ jobs:
333344
extra_lit_opts: --param sycl_build_targets="spir;nvidia;amd"
334345

335346
- name: Remove E2E tests before spirv-backend run
336-
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
347+
if: ${{ inputs.e2e_binaries_spirv_backend_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
337348
run: rm -rf build-e2e
338349

339350
- name: Build E2E tests with SPIR-V Backend
340-
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
351+
if: ${{ inputs.e2e_binaries_spirv_backend_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
341352
uses: ./devops/actions/run-tests/e2e
342353
with:
343354
ref: ${{ inputs.ref || github.sha }}
344355
testing_mode: build-only
345356
target_devices: all
346-
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}_spirv_backend
357+
binaries_artifact: ${{ inputs.e2e_binaries_spirv_backend_artifact }}
347358
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
348359
extra_lit_opts: --param spirv-backend=True
349360

350361
- name: Remove E2E tests before preview-mode run
351-
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
362+
if: ${{ inputs.e2e_binaries_preview_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
352363
run: rm -rf build-e2e
353364

354365
- name: Build E2E tests in Preview Mode
355-
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
366+
if: ${{ inputs.e2e_binaries_preview_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
356367
uses: ./devops/actions/run-tests/e2e
357368
with:
358369
ref: ${{ inputs.ref || github.sha }}
359370
testing_mode: build-only
360371
target_devices: all
361-
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}_preview
372+
binaries_artifact: ${{ inputs.e2e_binaries_preview_artifact }}
362373
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
363374
extra_lit_opts: --param test-preview-mode=True

.github/workflows/sycl-linux-precommit.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ jobs:
5858
changes: ${{ needs.detect_changes.outputs.filters }}
5959

6060
toolchain_artifact: sycl_linux_default
61-
e2e_binaries_artifact: sycl_e2e_bin_default
61+
e2e_binaries_artifact: e2e_bin
62+
e2e_binaries_spirv_backend_artifact: e2e_bin_spirv_backend
63+
e2e_binaries_preview_artifact: e2e_bin_preview
6264

6365
# If a PR changes CUDA adapter, run the build on Ubuntu 22.04 as well.
6466
# Ubuntu 22.04 container has CUDA 12.1 installed while Ubuntu 24.0 image
@@ -131,13 +133,13 @@ jobs:
131133
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
132134
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
133135
extra_lit_opts: --param spirv-backend=True
134-
e2e_binaries_artifact: sycl_e2e_bin_default_spirv_backend
136+
e2e_binaries_artifact: e2e_bin_spirv_backend
135137
- name: Preview Mode
136138
runner: '["Linux", "gen12"]'
137139
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
138140
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
139141
extra_lit_opts: --param test-preview-mode=True
140-
e2e_binaries_artifact: sycl_e2e_bin_default_preview
142+
e2e_binaries_artifact: e2e_bin_preview
141143

142144
uses: ./.github/workflows/sycl-linux-run-tests.yml
143145
with:
@@ -151,7 +153,7 @@ jobs:
151153
toolchain_artifact: ${{ needs.build.outputs.toolchain_artifact }}
152154
toolchain_artifact_filename: ${{ needs.build.outputs.toolchain_artifact_filename }}
153155
toolchain_decompress_command: ${{ needs.build.outputs.toolchain_decompress_command }}
154-
e2e_binaries_artifact: ${{ matrix.e2e_binaries_artifact || 'sycl_e2e_bin_default' }}
156+
e2e_binaries_artifact: ${{ matrix.e2e_binaries_artifact || 'e2e_bin' }}
155157
e2e_testing_mode: 'run-only'
156158

157159
# Do not install drivers on AMD and CUDA runners.

0 commit comments

Comments
 (0)