Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Prebuild E2E tests as part of build workflow
Browse files Browse the repository at this point in the history
aelovikov-intel committed Jan 21, 2025
1 parent 9fa1bb9 commit 52ab1c0
Showing 4 changed files with 48 additions and 21 deletions.
36 changes: 35 additions & 1 deletion .github/workflows/sycl-linux-build.yml
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ on:
build_image:
type: choice
options:
- "ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build"
- "ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps"
cc:
type: choice
options:
@@ -217,6 +217,7 @@ jobs:
# TODO consider moving this to Dockerfile.
export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
LIT_OPTS="--allow-empty-runs" LIT_FILTER="e2e_test_requirements" cmake --build $GITHUB_WORKSPACE/build --target check-sycl
- name: Install
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
# TODO replace utility installation with a single CMake target
@@ -237,6 +238,39 @@ jobs:
cmake --build $GITHUB_WORKSPACE/build --target install-clang-libraries
cmake --build $GITHUB_WORKSPACE/build --target install-llvm-libraries
- name: Source OneAPI TBB vars.sh
shell: bash
run: |
# https://github.com/actions/runner/issues/1964 prevents us from using
# the ENTRYPOINT in the image.
env | sort > env_before
if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then
source /runtimes/oneapi-tbb/env/vars.sh;
elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then
source /opt/runtimes/oneapi-tbb/env/vars.sh;
else
echo "no TBB vars in /opt/runtimes or /runtimes";
fi
env | sort > env_after
comm -13 env_before env_after >> $GITHUB_ENV
rm env_before env_after
- name: Build E2E tests
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
env:
LIT_OPTS: "-v --show-unsupported --show-pass --show-xfail --time-tests --param test-mode=build-only"
run: |
cmake --build $GITHUB_WORKSPACE/build --target check-sycl-e2e
- name: Pack E2E binaries
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
run: tar -I 'zstd -9' -cf e2e_binaries.tar.zst -C $GITHUB_WORKSPACE/build/tools/sycl/test-e2e .
- name: Upload E2E binaries
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
uses: actions/upload-artifact@v4
with:
name: sycl_e2e_bin_default
path: e2e_binaries.tar.zst
retention-days: 1

- name: Pack toolchain
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/build/install .
19 changes: 2 additions & 17 deletions .github/workflows/sycl-linux-precommit.yml
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ jobs:
build_artifact_suffix: "default"
build_cache_suffix: "default"
# Docker image has last nightly pre-installed and added to the PATH
build_image: "ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build"
build_image: "ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest"
cc: clang
cxx: clang++
changes: ${{ needs.detect_changes.outputs.filters }}
@@ -74,23 +74,8 @@ jobs:
echo 'arc_tests="Matrix/"' >> "$GITHUB_OUTPUT"
fi
build_e2e_tests:
needs: [build]
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
uses: ./.github/workflows/sycl-linux-run-tests.yml
with:
name: Build e2e tests
runner: '["Linux", "build"]'
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps
image_options: -u 1001
ref: ${{ github.sha }}
merge_ref: ''
sycl_toolchain_artifact: sycl_linux_default
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }}
e2e_testing_mode: 'build-only'
run_prebuilt_e2e_tests:
needs: [build, build_e2e_tests]
needs: [build]
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
strategy:
fail-fast: false
8 changes: 5 additions & 3 deletions .github/workflows/sycl-linux-run-tests.yml
Original file line number Diff line number Diff line change
@@ -320,9 +320,10 @@ jobs:
- name: Extract E2E Binaries
if: inputs.e2e_binaries_artifact != ''
run: |
mkdir build-e2e
mkdir -p build-e2e
# NOTE: this overwrites content of `build-e2e` so has to be done before
# cmake below.
tar -I 'zstd' -xf e2e_binaries.tar.zst -C build-e2e
- name: Deduce E2E CMake options
if: inputs.tests_selector == 'e2e' && inputs.e2e_binaries_artifact == ''
id: cmake_opts
@@ -334,7 +335,7 @@ jobs:
echo "opts=$CMAKE_EXTRA_ARGS" >> $GITHUB_OUTPUT
fi
- name: Configure E2E tests
if: inputs.tests_selector == 'e2e' && inputs.e2e_binaries_artifact == ''
if: inputs.tests_selector == 'e2e'
run: |
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 }}
- name: SYCL End-to-end tests
@@ -350,6 +351,7 @@ jobs:
awk '/^Failed Tests|Unexpectedly Passed Tests|Unresolved tests|Testing Time/{flag=1}/FAILED: CMakeFiles/{flag=0}flag' e2e.log >> $GITHUB_STEP_SUMMARY
fi
exit $exit_code
- name: Build SYCL CTS tests
if: inputs.tests_selector == 'cts' && inputs.sycl_cts_artifact == ''
env:
6 changes: 6 additions & 0 deletions sycl/test-e2e/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -14,6 +14,12 @@ if(SYCL_TEST_E2E_STANDALONE)
if( NOT OpenCL_LIBRARY )
find_package(OpenCL)
endif()
else()
if( NOT OpenCL_LIBRARY )
set(OpenCL_LIBRARY "${LLVM_BINARY_DIR}/lib")
endif()
set(LEVEL_ZERO_INCLUDE "${LLVM_BINARY_DIR}/_deps/level-zero-loader-src/include")
set(LEVEL_ZERO_LIBS_DIR "${LLVM_BINARY_DIR}/lib")
endif() # Standalone.

if(SYCL_TEST_E2E_STANDALONE)

0 comments on commit 52ab1c0

Please sign in to comment.