From 2060b2a65656570dc388b347f052fe855a9dce9e Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Fri, 17 Jan 2025 11:34:28 -0800 Subject: [PATCH] [CI] Prebuild E2E tests as part of build workflow --- .github/workflows/sycl-linux-build.yml | 34 +++++++++++++++++++++- .github/workflows/sycl-linux-precommit.yml | 19 ++---------- sycl/test-e2e/CMakeLists.txt | 4 +++ 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/.github/workflows/sycl-linux-build.yml b/.github/workflows/sycl-linux-build.yml index 6221afd481938..c195f7ffc493d 100644 --- a/.github/workflows/sycl-linux-build.yml +++ b/.github/workflows/sycl-linux-build.yml @@ -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,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 . diff --git a/.github/workflows/sycl-linux-precommit.yml b/.github/workflows/sycl-linux-precommit.yml index 79beaaeb274be..e89dbe7558fe3 100644 --- a/.github/workflows/sycl-linux-precommit.yml +++ b/.github/workflows/sycl-linux-precommit.yml @@ -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 diff --git a/sycl/test-e2e/CMakeLists.txt b/sycl/test-e2e/CMakeLists.txt index 2379d7859e6a5..8f176729a8655 100644 --- a/sycl/test-e2e/CMakeLists.txt +++ b/sycl/test-e2e/CMakeLists.txt @@ -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)