Skip to content

Commit 087d620

Browse files
authored
[CI] Run windows E2E tests with composite action (#18124)
1 parent 68e51aa commit 087d620

File tree

4 files changed

+144
-82
lines changed

4 files changed

+144
-82
lines changed

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ on:
2525
description: 'Artifacts retention period'
2626
type: string
2727
default: 3
28+
e2e_binaries_artifact:
29+
type: string
30+
required: false
2831
compiler:
2932
type: string
3033
required: false
@@ -78,7 +81,7 @@ permissions: read-all
7881
jobs:
7982
build:
8083
name: Build + LIT
81-
runs-on: [Windows, build]
84+
runs-on: [Windows, build-e2e]
8285
environment: WindowsCILock
8386
outputs:
8487
build_conclusion: ${{ steps.build.conclusion }}
@@ -226,6 +229,22 @@ jobs:
226229
name: sycl_windows_default
227230
path: ${{ inputs.artifact_archive_name }}
228231
retention-days: ${{ inputs.retention-days }}
232+
233+
- name: Setup SYCL toolchain
234+
run: |
235+
echo "PATH=$env:GITHUB_WORKSPACE\\install\\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
236+
echo "LIB=$env:GITHUB_WORKSPACE\\install\\lib;$env:LIB" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
237+
238+
- name: Build E2E tests
239+
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
240+
uses: ./devops/actions/run-tests/windows/e2e
241+
with:
242+
ref: ${{ inputs.ref || github.sha }}
243+
testing_mode: build-only
244+
target_devices: all
245+
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}
246+
extra_lit_opts: --param sycl_build_targets="spir"
247+
229248
- name: Detect hung tests
230249
if: always()
231250
shell: powershell

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

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,10 @@ jobs:
4949
uses: ./.github/workflows/sycl-windows-build.yml
5050
with:
5151
changes: ${{ needs.detect_changes.outputs.filters }}
52-
53-
build-e2e:
54-
needs: build
55-
# Continue if build was successful.
56-
if: |
57-
always()
58-
&& !cancelled()
59-
&& needs.build.outputs.build_conclusion == 'success'
60-
uses: ./.github/workflows/sycl-windows-run-tests.yml
61-
with:
62-
name: Build Windows E2E tests
63-
runner: '["Windows", "build-e2e"]'
64-
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
65-
e2e_testing_mode: build-only
66-
extra_lit_opts: --param sycl_build_targets="spir"
6752
e2e_binaries_artifact: sycl_windows_e2ebin
6853

6954
run_prebuilt_e2e_tests:
70-
needs: [build, build-e2e]
55+
needs: build
7156
# Continue if build was successful.
7257
if: |
7358
always()
@@ -85,6 +70,7 @@ jobs:
8570
with:
8671
name: ${{ matrix.name }}
8772
runner: ${{ matrix.runner }}
73+
target_devices: "level_zero:gpu"
8874
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
8975
e2e_testing_mode: run-only
9076
e2e_binaries_artifact: sycl_windows_e2ebin

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

Lines changed: 10 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -152,73 +152,18 @@ jobs:
152152
- run: |
153153
sycl-ls --verbose
154154
155-
- name: Download E2E Binaries
156-
if: ${{ inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'run-only' }}
157-
uses: actions/download-artifact@v4
158-
with:
159-
name: ${{ inputs.e2e_binaries_artifact }}
160-
- name: Extract E2E Binaries
161-
if: ${{ inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'run-only' }}
162-
shell: bash
163-
run: |
164-
mkdir build-e2e
165-
tar -xf e2e_bin.tar.gz -C build-e2e
166-
167-
- name: Configure E2E with Level Zero target
168-
if: inputs.tests_selector == 'e2e'
169-
shell: cmd
170-
run: |
171-
mkdir build-e2e
172-
cmake -GNinja -B build-e2e -S.\llvm\sycl\test-e2e -DSYCL_TEST_E2E_TARGETS="level_zero:gpu" -DCMAKE_CXX_COMPILER="clang++" -DLEVEL_ZERO_LIBS_DIR="D:\\github\\level-zero_win-sdk\\lib" -DLEVEL_ZERO_INCLUDE="D:\\github\\level-zero_win-sdk\\include" -DLLVM_LIT="..\\llvm\\llvm\\utils\\lit\\lit.py"
173-
174-
- name: Keep track of files after configuring E2E step
175-
if: ${{ always() && inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'build-only' }}
176-
shell: bash
177-
run: ls build-e2e > e2econf_files.txt
178-
179-
- name: Run End-to-End tests
155+
- name: Run E2E Tests
180156
if: inputs.tests_selector == 'e2e'
181-
shell: bash {0}
182-
env:
183-
LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time ${{ inputs.e2e_testing_mode == 'run-only' && 1200 || 3600 }} --time-tests --param print_features=True --param test-mode=${{ inputs.e2e_testing_mode }} ${{ inputs.extra_lit_opts }}
184-
run: |
185-
# Run E2E tests.
186-
if [[ ${{inputs.compiler}} == 'icx' ]]; then
187-
export LIT_FILTER_OUT="compile_on_win_with_mdd"
188-
fi
189-
cmake --build build-e2e --target check-sycl-e2e > e2e.log 2>&1
190-
191-
exit_code=$?
192-
cat e2e.log
193-
if [ $exit_code -ne 0 ]; then
194-
# This is duplicated between lin/win, updates must change both.
195-
awk '/^Failed Tests|Unexpectedly Passed Tests|Unresolved tests|Timed Out Tests|Testing Time/{flag=1}/FAILED: CMakeFiles/{flag=0}flag' e2e.log >> $GITHUB_STEP_SUMMARY
196-
fi
197-
exit $exit_code
198-
199-
# Github CI doesn't support containers on Windows, so we cannot guarantee
200-
# that paths are the same between building and running systems. To avoid
201-
# CMake issues related to absolute paths we reconfigure the build-e2e
202-
# folder on the run system.
203-
- name: Remove E2E configuration files
204-
if: ${{ always() && inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'build-only' }}
205-
shell: bash
206-
run: |
207-
for FILE in $(cat e2econf_files.txt); do rm -r build-e2e/$FILE; done
208-
rm e2econf_files.txt
209-
210-
- name: Pack E2E test binaries
211-
if: ${{ always() && !cancelled() && inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'build-only' }}
212-
shell: bash
213-
run: |
214-
tar -czf e2e_bin.tar.gz -C build-e2e .
215-
- name: Upload E2E test binaries
216-
if: ${{ always() && !cancelled() && inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'build-only' }}
217-
uses: actions/upload-artifact@v4
157+
uses: ./devops/actions/run-tests/windows/e2e
158+
timeout-minutes: 60
218159
with:
219-
name: ${{ inputs.e2e_binaries_artifact }}
220-
path: e2e_bin.tar.gz
221-
retention-days: 3
160+
ref: ${{ inputs.tests_ref || inputs.repo_ref || github.sha }}
161+
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}
162+
testing_mode: ${{ inputs.e2e_testing_mode }}
163+
extra_cmake_args: ${{ inputs.extra_cmake_args }}
164+
target_devices: ${{ inputs.target_devices }}
165+
extra_lit_opts: ${{ inputs.extra_lit_opts }}
166+
retention-days: ${{ inputs.artifact_retention_days }}
222167

223168
- name: Run SYCL CTS Tests
224169
if: inputs.tests_selector == 'cts'
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: 'Run SYCL E2E tests on Windows'
2+
3+
inputs:
4+
ref:
5+
required: false
6+
binaries_artifact:
7+
required: false
8+
testing_mode:
9+
required: true
10+
extra_cmake_args:
11+
required: false
12+
target_devices:
13+
required: true
14+
extra_lit_opts:
15+
required: false
16+
retention-days:
17+
required: false
18+
cxx_compiler:
19+
required: false
20+
21+
22+
runs:
23+
using: "composite"
24+
steps:
25+
- name: Checkout E2E tests
26+
uses: actions/checkout@v4
27+
with:
28+
path: llvm
29+
ref: ${{ inputs.ref || github.sha }}
30+
sparse-checkout: |
31+
llvm/utils/lit
32+
sycl/test-e2e
33+
- name: Download E2E Binaries
34+
if: inputs.testing_mode == 'run-only'
35+
uses: actions/download-artifact@v4
36+
with:
37+
name: ${{ inputs.binaries_artifact }}
38+
- name: Extract E2E Binaries
39+
if: inputs.testing_mode == 'run-only'
40+
shell: bash
41+
run: |
42+
mkdir build-e2e
43+
tar -xf e2e_bin.tar.gz -C build-e2e
44+
45+
- name: Deduce E2E CMake options
46+
id: cmake_opts
47+
shell: bash
48+
env:
49+
CMAKE_EXTRA_ARGS: ${{ inputs.extra_cmake_args }}
50+
run: |
51+
if [ -n "$CMAKE_EXTRA_ARGS" ]; then
52+
echo "opts=$CMAKE_EXTRA_ARGS" >> $GITHUB_OUTPUT
53+
fi
54+
55+
- name: Make E2E folder
56+
if: inputs.testing_mode != 'run-only'
57+
shell: bash
58+
run: |
59+
mkdir build-e2e
60+
61+
- name: Configure E2E tests
62+
shell: bash
63+
run: |
64+
cmake -GNinja -B build-e2e -S./llvm/sycl/test-e2e -DCMAKE_CXX_COMPILER="${{ inputs.cxx_compiler || '$(which clang++).exe' }}" -DLEVEL_ZERO_LIBS_DIR="D:\\github\\level-zero_win-sdk\\lib" -DLEVEL_ZERO_INCLUDE="D:\\github\\level-zero_win-sdk\\include" -DLLVM_LIT="..\\llvm\\llvm\\utils\\lit\\lit.py" ${{ steps.cmake_opts.outputs.opts }}
65+
66+
- name: Keep track of files after configuring E2E step
67+
if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}}
68+
shell: bash
69+
run: ls build-e2e > e2econf_files.txt
70+
71+
- name: Run End-to-End tests
72+
shell: bash {0}
73+
env:
74+
LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time ${{ inputs.e2e_testing_mode == 'run-only' && 1200 || 3600 }} --time-tests --param print_features=True --param test-mode=${{ inputs.testing_mode }} --param sycl_devices=${{ inputs.target_devices }} ${{ inputs.extra_lit_opts }}
75+
run: |
76+
# Run E2E tests.
77+
if [[ ${{ inputs.cxx_compiler || '$(which clang++).exe' }} == 'icx' ]]; then
78+
export LIT_FILTER_OUT="compile_on_win_with_mdd"
79+
fi
80+
cmake --build build-e2e --target check-sycl-e2e > e2e.log 2>&1
81+
82+
exit_code=$?
83+
cat e2e.log
84+
if [ $exit_code -ne 0 ]; then
85+
# This is duplicated between lin/win, updates must change both.
86+
awk '/^Failed Tests|Unexpectedly Passed Tests|Unresolved tests|Timed Out Tests|Testing Time/{flag=1}/FAILED: CMakeFiles/{flag=0}flag' e2e.log >> $GITHUB_STEP_SUMMARY
87+
fi
88+
exit $exit_code
89+
90+
# Github CI doesn't support containers on Windows, so we cannot guarantee
91+
# that paths are the same between building and running systems. To avoid
92+
# CMake issues related to absolute paths we reconfigure the build-e2e
93+
# folder on the run system.
94+
- name: Remove E2E configuration files
95+
if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}}
96+
shell: bash
97+
run: |
98+
for FILE in $(cat e2econf_files.txt); do rm -r build-e2e/$FILE; done
99+
rm e2econf_files.txt
100+
101+
- name: Pack E2E test binaries
102+
if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}}
103+
shell: bash
104+
run: |
105+
tar -czf e2e_bin.tar.gz -C build-e2e .
106+
- name: Upload E2E test binaries
107+
if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}}
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: ${{ inputs.binaries_artifact }}
111+
path: e2e_bin.tar.gz
112+
retention-days: ${{ inputs.retention-days }}

0 commit comments

Comments
 (0)