Skip to content

Commit

Permalink
[CI] Prebuild E2E tests as part of build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aelovikov-intel committed Jan 21, 2025
1 parent 9fa1bb9 commit 2060b2a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 18 deletions.
34 changes: 33 additions & 1 deletion .github/workflows/sycl-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -237,6 +238,37 @@ 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' }}
run: |
LIT_OPTS="--param test-mode=build-only" 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 .
Expand Down
19 changes: 2 additions & 17 deletions .github/workflows/sycl-linux-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions sycl/test-e2e/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ 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()
endif() # Standalone.

if(SYCL_TEST_E2E_STANDALONE)
Expand Down

0 comments on commit 2060b2a

Please sign in to comment.