Skip to content

Commit 68756aa

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 155fe36 commit 68756aa

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
@@ -50,6 +50,9 @@ on:
5050
description: 'Artifacts retention period'
5151
type: string
5252
default: 3
53+
e2e_binaries_artifact:
54+
type: string
55+
required: False
5356

5457
outputs:
5558
build_conclusion:
@@ -254,13 +257,13 @@ jobs:
254257
retention-days: ${{ inputs.retention-days }}
255258

256259
- name: Copy toolchain
257-
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
260+
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
258261
# We must have the compiler in the same location as it will be in the E2E
259262
# run-tests job.
260263
run: cp -r $GITHUB_WORKSPACE/build/install $GITHUB_WORKSPACE/toolchain
261264

262265
- name: Source OneAPI TBB vars.sh
263-
shell: bash
266+
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
264267
run: |
265268
# https://github.com/actions/runner/issues/1964 prevents us from using
266269
# the ENTRYPOINT in the image.
@@ -277,12 +280,12 @@ jobs:
277280
rm env_before env_after
278281
279282
- name: Build E2E tests
280-
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
283+
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
281284
uses: ./devops/actions/run-tests/e2e
282285
with:
283286
ref: ${{ inputs.ref || github.sha }}
284287
merge_ref: ${{ inputs.merge_ref }}
285-
e2e_testing_mode: build-only
288+
testing_mode: build-only
286289
target_devices: all
287-
artifact_suffix: default
290+
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}
288291
cxx_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++

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

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
cc: clang
5151
cxx: clang++
5252
changes: ${{ needs.detect_changes.outputs.filters }}
53+
e2e_binaries_artifact: sycl_e2e_bin_default
5354

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

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

+6-12
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,18 @@ on:
6161

6262
e2e_binaries_artifact:
6363
description: |
64-
By setting this the E2E binaries folder will not be created, rather it
65-
will be downloaded and extracted from the specified artifact. When
66-
running tests in `run-only` mode this must be provided.
64+
Must be set if `e2e_testing_mode` is equal to `run-only` and the
65+
artifact must exist. Can be set in other modes resulting in artifact
66+
upload.
6767
type: string
6868
default: ''
6969
required: False
7070
e2e_testing_mode:
7171
description: |
7272
Testing mode to run E2E tests in, can be either `full`, `build-only`
73-
or `run-only`. In `build-only` mode an artifact of the E2E binaries
74-
will be uploaded.
73+
or `run-only`.
7574
type: string
7675
default: 'full'
77-
artifact_suffix:
78-
description: 'Suffix for E2E binaries artifact that is output when in `build-only`.'
79-
type: string
80-
default: 'default'
8176
retention-days:
8277
description: 'E2E/SYCL-CTS binaries artifact retention period.'
8378
type: string
@@ -297,12 +292,11 @@ jobs:
297292
with:
298293
ref: ${{ inputs.ref || github.sha }}
299294
merge_ref: ${{ inputs.merge_ref }}
300-
e2e_binaries_artifact: ${{ inputs.e2e_binaries_artifact }}
295+
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}
296+
testing_mode: ${{ inputs.e2e_testing_mode }}
301297
extra_cmake_args: ${{ inputs.extra_cmake_args }}
302-
e2e_testing_mode: ${{ inputs.e2e_testing_mode }}
303298
target_devices: ${{ inputs.target_devices }}
304299
extra_lit_opts: ${{ inputs.extra_lit_opts }}
305-
artifact_suffix: ${{ inputs.artifact_suffix }}
306300
retention-days: ${{ inputs.retention-days }}
307301

308302
- name: Run SYCL CTS Tests

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

+12-14
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,16 @@ inputs:
55
required: false
66
merge_ref:
77
required: false
8-
e2e_binaries_artifact:
8+
binaries_artifact:
99
required: false
10+
testing_mode:
11+
required: true
1012
extra_cmake_args:
1113
required: false
12-
e2e_testing_mode:
13-
required: true
1414
target_devices:
1515
required: true
1616
extra_lit_opts:
1717
required: false
18-
artifact_suffix:
19-
required: false
2018
retention-days:
2119
required: false
2220
cxx_compiler:
@@ -35,19 +33,19 @@ runs:
3533
cache_path: "/__w/repo_cache/"
3634

3735
- name: Download E2E Binaries
38-
if: inputs.e2e_binaries_artifact != ''
36+
if: inputs.testing_mode == 'run-only'
3937
uses: actions/download-artifact@v4
4038
with:
41-
name: ${{ inputs.e2e_binaries_artifact }}
39+
name: ${{ inputs.binaries_artifact }}
4240
- name: Extract E2E Binaries
43-
if: inputs.e2e_binaries_artifact != ''
41+
if: inputs.testing_mode == 'run-only'
4442
shell: bash
4543
run: |
4644
mkdir build-e2e
4745
tar -I 'zstd' -xf e2e_binaries.tar.zst -C build-e2e
4846
4947
- name: Deduce E2E CMake options
50-
if: inputs.e2e_binaries_artifact == ''
48+
if: inputs.testing_mode != 'run-only'
5149
id: cmake_opts
5250
shell: bash
5351
env:
@@ -57,14 +55,14 @@ runs:
5755
echo "opts=$CMAKE_EXTRA_ARGS" >> $GITHUB_OUTPUT
5856
fi
5957
- name: Configure E2E tests
60-
if: inputs.e2e_binaries_artifact == ''
58+
if: inputs.testing_mode != 'run-only'
6159
shell: bash
6260
run: |
6361
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 }}
6462
- name: SYCL End-to-end tests
6563
shell: bash {0}
6664
env:
67-
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 }}
65+
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 }}
6866
run: |
6967
ninja -C build-e2e check-sycl-e2e > e2e.log 2>&1
7068
exit_code=$?
@@ -75,14 +73,14 @@ runs:
7573
exit $exit_code
7674
7775
- name: Pack E2E binaries
78-
if: ${{ always() && !cancelled() && inputs.e2e_testing_mode == 'build-only'}}
76+
if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}}
7977
shell: bash
8078
run: |
8179
tar -I 'zstd -9' -cf e2e_binaries.tar.zst -C ./build-e2e .
8280
- name: Upload E2E binaries
83-
if: ${{ always() && !cancelled() && inputs.e2e_testing_mode == 'build-only'}}
81+
if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}}
8482
uses: actions/upload-artifact@v4
8583
with:
86-
name: sycl_e2e_bin_${{ inputs.artifact_suffix }}
84+
name: ${{ inputs.binaries_artifact }}
8785
path: e2e_binaries.tar.zst
8886
retention-days: ${{ inputs.retention-days }}

0 commit comments

Comments
 (0)