diff --git a/.github/workflows/sycl-linux-build.yml b/.github/workflows/sycl-linux-build.yml index 923cf43da194f..e44158d7105cf 100644 --- a/.github/workflows/sycl-linux-build.yml +++ b/.github/workflows/sycl-linux-build.yml @@ -76,6 +76,14 @@ on: type: string required: false + cts_binaries_artifact: + type: string + required: false + cts_binaries_ref: + type: string + description: tag/ref of CTS tests to compile + default: main + outputs: build_conclusion: value: ${{ jobs.build.outputs.build_conclusion }} @@ -173,6 +181,7 @@ jobs: with: sparse-checkout: | devops/actions + sycl/cts_exclude_filter # Cleanup will be run after all actions are completed. - name: Register cleanup after job is finished uses: ./devops/actions/cleanup @@ -337,6 +346,16 @@ jobs: comm -13 env_before env_after >> $GITHUB_ENV rm env_before env_after + - name: Build CTS tests + if: ${{ inputs.cts_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} + uses: ./devops/actions/run-tests/cts + with: + ref: ${{ inputs.cts_binaries_ref }} + cts_testing_mode: build-only + target_devices: all + sycl_cts_artifact: ${{ inputs.cts_binaries_artifact }} + sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++ + - name: Build E2E tests if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} uses: ./devops/actions/run-tests/e2e diff --git a/.github/workflows/sycl-prebuilt-e2e-container.yml b/.github/workflows/sycl-prebuilt-e2e-container.yml index 3932c796180ec..dd067455241c8 100644 --- a/.github/workflows/sycl-prebuilt-e2e-container.yml +++ b/.github/workflows/sycl-prebuilt-e2e-container.yml @@ -1,8 +1,8 @@ name: Create container with pre-built tests -# The purpose of this is to build E2E tests with the latest release toolchain -# and then run them with the trunk SYCL RT (libsycl.so and friends) to verify -# that ABI compatibility hasn't been broken. +# The purpose of this is to build E2E and CTS tests with the latest release +# toolchain and then run them with the trunk SYCL RT (libsycl.so and friends) +# to verify that ABI compatibility hasn't been broken. on: workflow_dispatch: @@ -12,6 +12,18 @@ on: description: tag/sha required: true default: + cts_ref: + type: choice + description: tag/sha to use for SYCL-CTS -- hardcoded hash is CTS revision matching sycl-rel-N_M branch. + required: true + default: 'main' + options: + - main + # Author: Tom Deakin + # Date: Thu Jul 10 16:45:48 2025 +0100 + # Merge pull request #1102 from steffenlarsen/steffen/remove_secondary_queue_exceptions + # Remove expected exceptions for secondary queue + - 19e4ed34377c8a8a354d701772427be8c5430b0d push: branches: @@ -35,6 +47,12 @@ jobs: toolchain_artifact: toolchain toolchain_artifact_filename: toolchain.tar.zst e2e_binaries_artifact: e2e_bin + cts_binaries_artifact: cts_bin + # Author: Tom Deakin + # Date: Thu Jul 10 16:45:48 2025 +0100 + # Merge pull request #1102 from steffenlarsen/steffen/remove_secondary_queue_exceptions + # Remove expected exceptions for secondary queue + cts_binaries_ref: ${{ github.event_name == 'push' && '19e4ed34377c8a8a354d701772427be8c5430b0d' || inputs.cts_ref }} # Couldn't make it work from inside the container, so have to use an extra job # and pass an artifact. @@ -72,7 +90,11 @@ jobs: with: name: e2e_bin path: devops/ - + - name: Download CTS binaries + uses: actions/download-artifact@v5 + with: + name: cts_bin + path: devops/ - name: Build container uses: ./devops/actions/build_container @@ -84,14 +106,14 @@ jobs: tags: | ghcr.io/${{ github.repository }}/sycl_prebuilt_tests:${{ inputs.ref || github.ref_name }} - run-e2e: + run-prebuilt-tests: # Ensure those tests can actually pass with the toolchain they were built # with, otherwise testing compatibility with those binaries is pointless. # This job should be aligned with how the image will be used in trunk CI. # # I'll start with just a single configuration, but this might be extended # with a matrix in future (e.g., to run on cpu/CUDA/AMDGPU). - name: Run E2E tests with SYCL RT they were built with + name: Run E2E, CTS tests with SYCL RT they were built with runs-on: [Linux, pvc] needs: [docker, build] if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }} @@ -103,7 +125,8 @@ jobs: with: sparse-checkout: | devops - - run: | + - id: decompress + run: | mkdir toolchain tar -I 'zstd' -xf /sycl-prebuilt/toolchain.tar.zst -C toolchain echo LD_LIBRARY_PATH=$PWD/toolchain/lib:$LD_LIBRARY_PATH >> $GITHUB_ENV @@ -112,7 +135,15 @@ jobs: sycl-ls - name: Run E2E tests uses: ./devops/actions/run-tests/e2e + if: ${{ always() && !cancelled() && steps.decompress.outcome == 'success' }} timeout-minutes: 20 with: testing_mode: run-only target_devices: level_zero:gpu + - name: Run CTS tests + uses: ./devops/actions/run-tests/cts + if: ${{ always() && !cancelled() && steps.decompress.outcome == 'success' }} + timeout-minutes: 20 + with: + cts_testing_mode: run-only + target_devices: level_zero:gpu diff --git a/devops/actions/run-tests/cts/action.yml b/devops/actions/run-tests/cts/action.yml index d5c865d208b34..56dce850168dd 100644 --- a/devops/actions/run-tests/cts/action.yml +++ b/devops/actions/run-tests/cts/action.yml @@ -9,11 +9,13 @@ inputs: cts_testing_mode: required: true sycl_cts_artifact: - require: false + required: false target_devices: required: true retention-days: required: false + sycl_compiler: + required: false runs: using: "composite" @@ -56,7 +58,7 @@ runs: echo "::endgroup::" fi - cmake -GNinja -B./build-cts -S./khronos_sycl_cts -DCMAKE_CXX_COMPILER=$(which clang++) \ + cmake -GNinja -B./build-cts -S./khronos_sycl_cts -DCMAKE_CXX_COMPILER="${{ inputs.sycl_compiler || '$(which clang++)'}}" \ -DSYCL_IMPLEMENTATION=DPCPP \ -DSYCL_CTS_EXCLUDE_TEST_CATEGORIES="$cts_exclude_filter" \ -DSYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS=OFF \ @@ -81,18 +83,37 @@ runs: retention-days: ${{ inputs.retention-days }} - name: Download SYCL-CTS binaries - if: inputs.cts_testing_mode == 'run-only' + if: | + inputs.cts_testing_mode == 'run-only' + && !(inputs.sycl_cts_artifact == 'in-container' + || inputs.sycl_cts_artifact == '' + || github.event_name == 'workflow_dispatch') uses: actions/download-artifact@v4 with: name: ${{ inputs.sycl_cts_artifact }} - name: Extract SYCL-CTS binaries - if: inputs.cts_testing_mode == 'run-only' + if: | + inputs.cts_testing_mode == 'run-only' + && !(inputs.sycl_cts_artifact == 'in-container' + || inputs.sycl_cts_artifact == '' + || github.event_name == 'workflow_dispatch') shell: bash run: | mkdir -p build-cts/bin tar -I 'zstd' -xf sycl_cts_bin.tar.zst -C build-cts/bin + - name: Extract CTS tests from container image + if: | + inputs.cts_testing_mode == 'run-only' + && (inputs.sycl_cts_artifact == 'in-container' + || inputs.sycl_cts_artifact == '' + || github.event_name == 'workflow_dispatch') + shell: bash + run: | + mkdir -p build-cts/bin + tar -I 'zstd' -xf /sycl-prebuilt/sycl_cts_bin.tar.zst -C build-cts/bin + - name: SYCL CTS List devices # Proceed with execution even if the 'build' step did not succeed. if: (always() && !cancelled()) && inputs.cts_testing_mode != 'build-only' diff --git a/devops/containers/release_tests_binaries.Dockerfile b/devops/containers/release_tests_binaries.Dockerfile index 5c6e32718168a..000e43f911bf5 100644 --- a/devops/containers/release_tests_binaries.Dockerfile +++ b/devops/containers/release_tests_binaries.Dockerfile @@ -16,11 +16,13 @@ FROM $base_image:$base_tag ADD --chown=sycl:sycl toolchain.tar.zst /__w/llvm/llvm/toolchain ADD --chown=sycl:sycl e2e_binaries.tar.zst /__w/llvm/llvm/build-e2e ADD --chown=sycl:sycl e2e_sources.tar.zst /__w/llvm/llvm/llvm +ADD --chown=sycl:sycl sycl_cts_bin.tar.zst /__w/llvm/llvm/build-cts # Since `/__w/llvm/llvm` above is overriden by GHA, need to provide the # following for using in CI: COPY e2e_binaries.tar.zst /sycl-prebuilt/ COPY e2e_sources.tar.zst /sycl-prebuilt/ +COPY sycl_cts_bin.tar.zst /sycl-prebuilt/ COPY toolchain.tar.zst /sycl-prebuilt/ COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh