diff --git a/.github/workflows/sycl-linux-build.yml b/.github/workflows/sycl-linux-build.yml index d74260cf9436d..00d3cb4f2a23e 100644 --- a/.github/workflows/sycl-linux-build.yml +++ b/.github/workflows/sycl-linux-build.yml @@ -57,10 +57,18 @@ on: toolchain_artifact_filename: type: string default: llvm_sycl.tar.zst + + pack_release: + type: string + required: false + e2e_binaries_artifact: type: string required: false - pack_release: + e2e_binaries_spirv_backend_artifact: + type: string + required: false + e2e_binaries_preview_artifact: type: string required: false @@ -174,6 +182,10 @@ jobs: if: ${{ inputs.cc == 'icx' || inputs.cxx == 'icpx' }} uses: ./devops/actions/setup_linux_oneapi_env - name: Configure + # Setting `CMAKE_INSTALL_PREFIX` is important because that's the location + # where `sycl-linux-run-tests.yml` unpacks the toolchain to. That location + # *must* match between build-only and run-only E2E tests runs and we might + # be creating pre-built E2E tests' binaries in this workflow. env: CC: ${{ inputs.cc }} CXX: ${{ inputs.cxx }} @@ -183,7 +195,9 @@ jobs: mkdir -p $GITHUB_WORKSPACE/build cd $GITHUB_WORKSPACE/build python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \ - -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \ + -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build \ + -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/toolchain \ + -t Release \ --ci-defaults ${{ inputs.build_configure_extra_args }} \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ @@ -259,7 +273,7 @@ jobs: - name: Pack toolchain release if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true' }} - run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/build/install . + run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/toolchain . - name: Upload toolchain release if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true' }} uses: actions/upload-artifact@v4 @@ -289,7 +303,7 @@ jobs: - 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 . + run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/toolchain . - name: Upload toolchain if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }} uses: actions/upload-artifact@v4 @@ -298,14 +312,11 @@ jobs: path: ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} retention-days: ${{ inputs.retention-days }} - - name: Copy toolchain - if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} - # We must have the compiler in the same location as it will be in the E2E - # run-tests job. - run: cp -r $GITHUB_WORKSPACE/build/install $GITHUB_WORKSPACE/toolchain - name: Source OneAPI TBB vars.sh - if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} + # Tasks that use the just built toolchain below, need extra environment + # setup. No harm in it if all of those tasks would get skipped. + if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }} run: | # https://github.com/actions/runner/issues/1964 prevents us from using # the ENTRYPOINT in the image. @@ -333,31 +344,31 @@ jobs: extra_lit_opts: --param sycl_build_targets="spir;nvidia;amd" - name: Remove E2E tests before spirv-backend run - if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} + if: ${{ inputs.e2e_binaries_spirv_backend_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} run: rm -rf build-e2e - name: Build E2E tests with SPIR-V Backend - if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} + if: ${{ inputs.e2e_binaries_spirv_backend_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} uses: ./devops/actions/run-tests/e2e with: ref: ${{ inputs.ref || github.sha }} testing_mode: build-only target_devices: all - binaries_artifact: ${{ inputs.e2e_binaries_artifact }}_spirv_backend + binaries_artifact: ${{ inputs.e2e_binaries_spirv_backend_artifact }} sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++ extra_lit_opts: --param spirv-backend=True - name: Remove E2E tests before preview-mode run - if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} + if: ${{ inputs.e2e_binaries_preview_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} run: rm -rf build-e2e - name: Build E2E tests in Preview Mode - if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} + if: ${{ inputs.e2e_binaries_preview_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }} uses: ./devops/actions/run-tests/e2e with: ref: ${{ inputs.ref || github.sha }} testing_mode: build-only target_devices: all - binaries_artifact: ${{ inputs.e2e_binaries_artifact }}_preview + binaries_artifact: ${{ inputs.e2e_binaries_preview_artifact }} sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++ extra_lit_opts: --param test-preview-mode=True diff --git a/.github/workflows/sycl-linux-precommit.yml b/.github/workflows/sycl-linux-precommit.yml index dfc0eb2d8ec1e..1315ce8abd07e 100644 --- a/.github/workflows/sycl-linux-precommit.yml +++ b/.github/workflows/sycl-linux-precommit.yml @@ -58,7 +58,9 @@ jobs: changes: ${{ needs.detect_changes.outputs.filters }} toolchain_artifact: sycl_linux_default - e2e_binaries_artifact: sycl_e2e_bin_default + e2e_binaries_artifact: e2e_bin + e2e_binaries_spirv_backend_artifact: e2e_bin_spirv_backend + e2e_binaries_preview_artifact: e2e_bin_preview # If a PR changes CUDA adapter, run the build on Ubuntu 22.04 as well. # Ubuntu 22.04 container has CUDA 12.1 installed while Ubuntu 24.0 image @@ -131,13 +133,13 @@ jobs: image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN target_devices: level_zero:gpu;opencl:gpu;opencl:cpu extra_lit_opts: --param spirv-backend=True - e2e_binaries_artifact: sycl_e2e_bin_default_spirv_backend + e2e_binaries_artifact: e2e_bin_spirv_backend - name: Preview Mode runner: '["Linux", "gen12"]' image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN target_devices: level_zero:gpu;opencl:gpu;opencl:cpu extra_lit_opts: --param test-preview-mode=True - e2e_binaries_artifact: sycl_e2e_bin_default_preview + e2e_binaries_artifact: e2e_bin_preview uses: ./.github/workflows/sycl-linux-run-tests.yml with: @@ -151,7 +153,7 @@ jobs: toolchain_artifact: ${{ needs.build.outputs.toolchain_artifact }} toolchain_artifact_filename: ${{ needs.build.outputs.toolchain_artifact_filename }} toolchain_decompress_command: ${{ needs.build.outputs.toolchain_decompress_command }} - e2e_binaries_artifact: ${{ matrix.e2e_binaries_artifact || 'sycl_e2e_bin_default' }} + e2e_binaries_artifact: ${{ matrix.e2e_binaries_artifact || 'e2e_bin' }} e2e_testing_mode: 'run-only' # Do not install drivers on AMD and CUDA runners.