Skip to content

Commit a152855

Browse files
[CI] Refactor build/run-only logic in run-tests/e2e/action.yml
Reduce number of input parameters and make the logic a bit cleaner (IMO). This PR also uses that updated logic to make building E2E tests optional in `sycl-linux-build.yml` and makes enabled in pre-commit only for now, effectively fixing the regression in Nightly CI introduced in #16682.
1 parent 1dbe403 commit a152855

File tree

4 files changed

+27
-31
lines changed

4 files changed

+27
-31
lines changed

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

+8-5
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ on:
4444
description: 'Artifacts retention period'
4545
type: string
4646
default: 3
47+
e2e_binaries_artifact:
48+
type: string
49+
required: False
4750

4851
outputs:
4952
build_conclusion:
@@ -247,13 +250,13 @@ jobs:
247250
retention-days: ${{ inputs.retention-days }}
248251

249252
- name: Copy toolchain
250-
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
253+
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
251254
# We must have the compiler in the same location as it will be in the E2E
252255
# run-tests job.
253256
run: cp -r $GITHUB_WORKSPACE/build/install $GITHUB_WORKSPACE/toolchain
254257

255258
- name: Source OneAPI TBB vars.sh
256-
shell: bash
259+
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
257260
run: |
258261
# https://github.com/actions/runner/issues/1964 prevents us from using
259262
# the ENTRYPOINT in the image.
@@ -270,11 +273,11 @@ jobs:
270273
rm env_before env_after
271274
272275
- name: Build E2E tests
273-
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
276+
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
274277
uses: ./devops/actions/run-tests/e2e
275278
with:
276279
ref: ${{ inputs.ref || github.sha }}
277-
e2e_testing_mode: build-only
280+
testing_mode: build-only
278281
target_devices: all
279-
artifact_suffix: default
282+
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}
280283
cxx_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++

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

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
cc: clang
5050
cxx: clang++
5151
changes: ${{ needs.detect_changes.outputs.filters }}
52+
e2e_binaries_artifact: sycl_e2e_bin_default
5253

5354
determine_arc_tests:
5455
name: Decide which Arc tests to run

.github/workflows/sycl-linux-run-tests.yml

+6-12
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,18 @@ on:
5454

5555
e2e_binaries_artifact:
5656
description: |
57-
By setting this the E2E binaries folder will not be created, rather it
58-
will be downloaded and extracted from the specified artifact. When
59-
running tests in `run-only` mode this must be provided.
57+
Must be set if `e2e_testing_mode` is equal to `run-only` and the
58+
artifact must exist. Can be set in other modes resulting in artifact
59+
upload.
6060
type: string
6161
default: ''
6262
required: False
6363
e2e_testing_mode:
6464
description: |
6565
Testing mode to run E2E tests in, can be either `full`, `build-only`
66-
or `run-only`. In `build-only` mode an artifact of the E2E binaries
67-
will be uploaded.
66+
or `run-only`.
6867
type: string
6968
default: 'full'
70-
artifact_suffix:
71-
description: 'Suffix for E2E binaries artifact that is output when in `build-only`.'
72-
type: string
73-
default: 'default'
7469
retention-days:
7570
description: 'E2E/SYCL-CTS binaries artifact retention period.'
7671
type: string
@@ -289,12 +284,11 @@ jobs:
289284
uses: ./devops/actions/run-tests/e2e
290285
with:
291286
ref: ${{ inputs.ref || github.sha }}
292-
e2e_binaries_artifact: ${{ inputs.e2e_binaries_artifact }}
287+
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}
288+
testing_mode: ${{ inputs.e2e_testing_mode }}
293289
extra_cmake_args: ${{ inputs.extra_cmake_args }}
294-
e2e_testing_mode: ${{ inputs.e2e_testing_mode }}
295290
target_devices: ${{ inputs.target_devices }}
296291
extra_lit_opts: ${{ inputs.extra_lit_opts }}
297-
artifact_suffix: ${{ inputs.artifact_suffix }}
298292
retention-days: ${{ inputs.retention-days }}
299293

300294
- name: Run SYCL CTS Tests

devops/actions/run-tests/e2e/action.yml

+12-14
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@ name: 'Run SYCL E2E tests'
33
inputs:
44
ref:
55
required: false
6-
e2e_binaries_artifact:
6+
binaries_artifact:
77
required: false
8+
testing_mode:
9+
required: true
810
extra_cmake_args:
911
required: false
10-
e2e_testing_mode:
11-
required: true
1212
target_devices:
1313
required: true
1414
extra_lit_opts:
1515
required: false
16-
artifact_suffix:
17-
required: false
1816
retention-days:
1917
required: false
2018
cxx_compiler:
@@ -32,19 +30,19 @@ runs:
3230
cache_path: "/__w/repo_cache/"
3331

3432
- name: Download E2E Binaries
35-
if: inputs.e2e_binaries_artifact != ''
33+
if: inputs.testing_mode == 'run-only'
3634
uses: actions/download-artifact@v4
3735
with:
38-
name: ${{ inputs.e2e_binaries_artifact }}
36+
name: ${{ inputs.binaries_artifact }}
3937
- name: Extract E2E Binaries
40-
if: inputs.e2e_binaries_artifact != ''
38+
if: inputs.testing_mode == 'run-only'
4139
shell: bash
4240
run: |
4341
mkdir build-e2e
4442
tar -I 'zstd' -xf e2e_binaries.tar.zst -C build-e2e
4543
4644
- name: Deduce E2E CMake options
47-
if: inputs.e2e_binaries_artifact == ''
45+
if: inputs.testing_mode != 'run-only'
4846
id: cmake_opts
4947
shell: bash
5048
env:
@@ -54,14 +52,14 @@ runs:
5452
echo "opts=$CMAKE_EXTRA_ARGS" >> $GITHUB_OUTPUT
5553
fi
5654
- name: Configure E2E tests
57-
if: inputs.e2e_binaries_artifact == ''
55+
if: inputs.testing_mode != 'run-only'
5856
shell: bash
5957
run: |
6058
cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DCMAKE_CXX_COMPILER="${{ inputs.cxx_compiler || '$(which clang++)'}}" -DLLVM_LIT="$PWD/llvm/llvm/utils/lit/lit.py" ${{ steps.cmake_opts.outputs.opts }}
6159
- name: SYCL End-to-end tests
6260
shell: bash {0}
6361
env:
64-
LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests --param test-mode=${{ inputs.e2e_testing_mode }} --param sycl_devices=${{ inputs.target_devices }} ${{ inputs.extra_lit_opts }}
62+
LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests --param test-mode=${{ inputs.testing_mode }} --param sycl_devices=${{ inputs.target_devices }} ${{ inputs.extra_lit_opts }}
6563
run: |
6664
ninja -C build-e2e check-sycl-e2e > e2e.log 2>&1
6765
exit_code=$?
@@ -72,14 +70,14 @@ runs:
7270
exit $exit_code
7371
7472
- name: Pack E2E binaries
75-
if: ${{ always() && !cancelled() && inputs.e2e_testing_mode == 'build-only'}}
73+
if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}}
7674
shell: bash
7775
run: |
7876
tar -I 'zstd -9' -cf e2e_binaries.tar.zst -C ./build-e2e .
7977
- name: Upload E2E binaries
80-
if: ${{ always() && !cancelled() && inputs.e2e_testing_mode == 'build-only'}}
78+
if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}}
8179
uses: actions/upload-artifact@v4
8280
with:
83-
name: sycl_e2e_bin_${{ inputs.artifact_suffix }}
81+
name: ${{ inputs.binaries_artifact }}
8482
path: e2e_binaries.tar.zst
8583
retention-days: ${{ inputs.retention-days }}

0 commit comments

Comments
 (0)