Skip to content

Commit 5b31f6e

Browse files
[CI] Unify E2E/CTS workflows (#10538)
I plan to rename the workflow file and update the callers separately. This PR will be tested with a manually triggered workflow only.
1 parent 08ed6b4 commit 5b31f6e

File tree

1 file changed

+66
-10
lines changed

1 file changed

+66
-10
lines changed

.github/workflows/linux_single_e2e.yml

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ on:
2626
if inputs.target_devices contains 'ext_oneapi_hip'
2727
type: string
2828
required: False
29+
tests_selector:
30+
description: |
31+
Two possible options: "e2e" and "cts".
32+
type: string
33+
default: "e2e"
2934

3035
ref:
3136
type: string
@@ -92,12 +97,22 @@ on:
9297
- 'ext_oneapi_level_zero:gpu'
9398
- 'ext_oneapi_hip:gpu'
9499
- 'ext_intel_esimd_emulator:gpu'
100+
tests_selector:
101+
type: choice
102+
options:
103+
- e2e
104+
- cts
95105

96106
env:
97107
description: |
98-
Suggested variables: LIT_FILTER, LIT_FILTER_OUT. LIT_OPTS won't work
99-
as we redefine it as part of this workflow.
100-
default: '{"LIT_FILTER":""}'
108+
Suggested variables: for E2E tests - LIT_FILTER, LIT_FILTER_OUT.
109+
LIT_OPTS won't work as we redefine it as part of this workflow.
110+
111+
For SYCL CTS - CTS_TEST_ARGS that will be passed as an argument to the
112+
test_all executable.
113+
114+
Format: '{"VAR1":"VAL1","VAR2":"VAL2",...}'
115+
default: '{}'
101116

102117
install_drivers:
103118
type: choice
@@ -106,7 +121,7 @@ on:
106121
- true
107122

108123
jobs:
109-
lin_e2e_only:
124+
run:
110125
name: ${{ inputs.name }}
111126
runs-on: ${{ fromJSON(inputs.runner) }}
112127
container:
@@ -126,12 +141,27 @@ jobs:
126141
devops
127142
- name: Register cleanup after job is finished
128143
uses: ./devops/actions/cleanup
129-
- uses: ./devops/actions/cached_checkout
144+
- name: Checkout E2E tests
145+
if: inputs.tests_selector == 'e2e'
146+
uses: ./devops/actions/cached_checkout
130147
with:
131148
path: llvm
132149
ref: ${{ inputs.ref || github.sha }}
133150
merge_ref: ${{ inputs.merge_ref }}
134151
cache_path: "/__w/repo_cache/"
152+
- name: Checkout SYCL CTS tests
153+
if: inputs.tests_selector == 'cts'
154+
uses: ./devops/actions/cached_checkout
155+
with:
156+
path: khronos_sycl_cts
157+
repository: 'KhronosGroup/SYCL-CTS'
158+
ref: 'SYCL-2020'
159+
default_branch: 'SYCL-2020'
160+
cache_path: "/__w/repo_cache/"
161+
- name: SYCL CTS GIT submodules init
162+
if: inputs.tests_selector == 'cts'
163+
run: |
164+
git -C khronos_sycl_cts submodule update --init
135165
- name: Install drivers
136166
if: inputs.install_drivers == 'true'
137167
run: |
@@ -179,25 +209,51 @@ jobs:
179209
- run: which clang++ sycl-ls
180210
- run: sycl-ls --verbose
181211
- run: SYCL_PI_TRACE=-1 sycl-ls
182-
- name: Deduce CMake options
212+
213+
- name: Deduce E2E CMake options
214+
if: inputs.tests_selector == 'e2e'
183215
id: cmake_opts
184216
shell: bash
217+
env:
218+
CMAKE_EXTRA_ARGS: ${{ inputs.extra_cmake_args }}
185219
run: |
186-
if [ -n "${{ inputs.extra_cmake_args }}" ]; then
187-
echo 'opts=${{ inputs.extra_cmake_args }}' >> $GITHUB_OUTPUT
220+
if [ -n "$CMAKE_EXTRA_ARGS" ]; then
221+
echo 'opts=$CMAKE_EXTRA_ARGS' >> $GITHUB_OUTPUT
188222
else
189223
if [ "${{ contains(inputs.target_devices, 'ext_oneapi_hip') }}" == "true" ]; then
190224
echo 'opts=-DHIP_PLATFORM="AMD" -DAMD_ARCH="gfx1031"' >> $GITHUB_OUTPUT
191225
else
192226
echo 'opts=' >> $GITHUB_OUTPUT
193227
fi
194228
fi
195-
- run: echo ${{ steps.cmake_opts.outputs.opts }}
196-
- name: Configure
229+
- name: Configure E2E tests
230+
if: inputs.tests_selector == 'e2e'
197231
run: |
198232
cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DSYCL_TEST_E2E_TARGETS="${{ inputs.target_devices }}" -DCMAKE_CXX_COMPILER="$(which clang++)" -DLLVM_LIT="$PWD/llvm/llvm/utils/lit/lit.py" ${{ steps.cmake_opts.outputs.opts }}
199233
- name: SYCL End-to-end tests
234+
if: inputs.tests_selector == 'e2e'
200235
env:
201236
LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests
202237
run: |
203238
ninja -C build-e2e check-sycl-e2e
239+
240+
- name: Build SYCL CTS tests
241+
if: inputs.tests_selector == 'cts'
242+
env:
243+
CMAKE_EXTRA_ARGS: ${{ inputs.extra_cmake_args }}
244+
run: |
245+
cmake -GNinja -B./build-cts -S./khronos_sycl_cts -DCMAKE_CXX_COMPILER=$(which clang++) \
246+
-DSYCL_IMPLEMENTATION=DPCPP \
247+
-DSYCL_CTS_EXCLUDE_TEST_CATEGORIES="$PWD/devops/cts_exclude_filter" \
248+
-DSYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS=OFF \
249+
-DSYCL_CTS_MEASURE_BUILD_TIMES=ON \
250+
-DDPCPP_INSTALL_DIR="$$(dirname (which clang++))/.." \
251+
$CMAKE_EXTRA_ARGS
252+
ninja -C build-cts
253+
- name: Run SYCL CTS tests
254+
if: inputs.tests_selector == 'cts'
255+
env:
256+
ONEAPI_DEVICE_SELECTOR: ${{ inputs.target_devices }}
257+
run: |
258+
./build-cts/bin/test_all --list-devices
259+
./build-cts/bin/test_all $CTS_TEST_ARGS

0 commit comments

Comments
 (0)