Skip to content

Commit 52ab1c0

Browse files
[CI] Prebuild E2E tests as part of build workflow
1 parent 9fa1bb9 commit 52ab1c0

File tree

4 files changed

+48
-21
lines changed

4 files changed

+48
-21
lines changed

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

+35-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ on:
7070
build_image:
7171
type: choice
7272
options:
73-
- "ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build"
73+
- "ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps"
7474
cc:
7575
type: choice
7676
options:
@@ -217,6 +217,7 @@ jobs:
217217
# TODO consider moving this to Dockerfile.
218218
export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
219219
LIT_OPTS="--allow-empty-runs" LIT_FILTER="e2e_test_requirements" cmake --build $GITHUB_WORKSPACE/build --target check-sycl
220+
220221
- name: Install
221222
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
222223
# TODO replace utility installation with a single CMake target
@@ -237,6 +238,39 @@ jobs:
237238
cmake --build $GITHUB_WORKSPACE/build --target install-clang-libraries
238239
cmake --build $GITHUB_WORKSPACE/build --target install-llvm-libraries
239240
241+
- name: Source OneAPI TBB vars.sh
242+
shell: bash
243+
run: |
244+
# https://github.com/actions/runner/issues/1964 prevents us from using
245+
# the ENTRYPOINT in the image.
246+
env | sort > env_before
247+
if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then
248+
source /runtimes/oneapi-tbb/env/vars.sh;
249+
elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then
250+
source /opt/runtimes/oneapi-tbb/env/vars.sh;
251+
else
252+
echo "no TBB vars in /opt/runtimes or /runtimes";
253+
fi
254+
env | sort > env_after
255+
comm -13 env_before env_after >> $GITHUB_ENV
256+
rm env_before env_after
257+
- name: Build E2E tests
258+
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
259+
env:
260+
LIT_OPTS: "-v --show-unsupported --show-pass --show-xfail --time-tests --param test-mode=build-only"
261+
run: |
262+
cmake --build $GITHUB_WORKSPACE/build --target check-sycl-e2e
263+
- name: Pack E2E binaries
264+
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
265+
run: tar -I 'zstd -9' -cf e2e_binaries.tar.zst -C $GITHUB_WORKSPACE/build/tools/sycl/test-e2e .
266+
- name: Upload E2E binaries
267+
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
268+
uses: actions/upload-artifact@v4
269+
with:
270+
name: sycl_e2e_bin_default
271+
path: e2e_binaries.tar.zst
272+
retention-days: 1
273+
240274
- name: Pack toolchain
241275
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
242276
run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/build/install .

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

+2-17
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
build_artifact_suffix: "default"
4848
build_cache_suffix: "default"
4949
# Docker image has last nightly pre-installed and added to the PATH
50-
build_image: "ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build"
50+
build_image: "ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest"
5151
cc: clang
5252
cxx: clang++
5353
changes: ${{ needs.detect_changes.outputs.filters }}
@@ -74,23 +74,8 @@ jobs:
7474
echo 'arc_tests="Matrix/"' >> "$GITHUB_OUTPUT"
7575
fi
7676
77-
build_e2e_tests:
78-
needs: [build]
79-
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
80-
uses: ./.github/workflows/sycl-linux-run-tests.yml
81-
with:
82-
name: Build e2e tests
83-
runner: '["Linux", "build"]'
84-
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps
85-
image_options: -u 1001
86-
ref: ${{ github.sha }}
87-
merge_ref: ''
88-
sycl_toolchain_artifact: sycl_linux_default
89-
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
90-
sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }}
91-
e2e_testing_mode: 'build-only'
9277
run_prebuilt_e2e_tests:
93-
needs: [build, build_e2e_tests]
78+
needs: [build]
9479
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
9580
strategy:
9681
fail-fast: false

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,10 @@ jobs:
320320
- name: Extract E2E Binaries
321321
if: inputs.e2e_binaries_artifact != ''
322322
run: |
323-
mkdir build-e2e
323+
mkdir -p build-e2e
324+
# NOTE: this overwrites content of `build-e2e` so has to be done before
325+
# cmake below.
324326
tar -I 'zstd' -xf e2e_binaries.tar.zst -C build-e2e
325-
326327
- name: Deduce E2E CMake options
327328
if: inputs.tests_selector == 'e2e' && inputs.e2e_binaries_artifact == ''
328329
id: cmake_opts
@@ -334,7 +335,7 @@ jobs:
334335
echo "opts=$CMAKE_EXTRA_ARGS" >> $GITHUB_OUTPUT
335336
fi
336337
- name: Configure E2E tests
337-
if: inputs.tests_selector == 'e2e' && inputs.e2e_binaries_artifact == ''
338+
if: inputs.tests_selector == 'e2e'
338339
run: |
339340
cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DCMAKE_CXX_COMPILER="$(which clang++)" -DLLVM_LIT="$PWD/llvm/llvm/utils/lit/lit.py" ${{ steps.cmake_opts.outputs.opts }}
340341
- name: SYCL End-to-end tests
@@ -350,6 +351,7 @@ jobs:
350351
awk '/^Failed Tests|Unexpectedly Passed Tests|Unresolved tests|Testing Time/{flag=1}/FAILED: CMakeFiles/{flag=0}flag' e2e.log >> $GITHUB_STEP_SUMMARY
351352
fi
352353
exit $exit_code
354+
353355
- name: Build SYCL CTS tests
354356
if: inputs.tests_selector == 'cts' && inputs.sycl_cts_artifact == ''
355357
env:

sycl/test-e2e/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ if(SYCL_TEST_E2E_STANDALONE)
1414
if( NOT OpenCL_LIBRARY )
1515
find_package(OpenCL)
1616
endif()
17+
else()
18+
if( NOT OpenCL_LIBRARY )
19+
set(OpenCL_LIBRARY "${LLVM_BINARY_DIR}/lib")
20+
endif()
21+
set(LEVEL_ZERO_INCLUDE "${LLVM_BINARY_DIR}/_deps/level-zero-loader-src/include")
22+
set(LEVEL_ZERO_LIBS_DIR "${LLVM_BINARY_DIR}/lib")
1723
endif() # Standalone.
1824

1925
if(SYCL_TEST_E2E_STANDALONE)

0 commit comments

Comments
 (0)