Skip to content

Commit 5f69e3e

Browse files
[CI] Prebuild E2E tests as part of build workflow (#16682)
This will allow us to save time on runner setup and toolchain download/unpacking.
1 parent 0885da8 commit 5f69e3e

File tree

3 files changed

+41
-20
lines changed

3 files changed

+41
-20
lines changed

.github/workflows/sycl-linux-build.yml

+36-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
build_image:
1515
type: string
1616
required: false
17-
default: "ghcr.io/intel/llvm/ubuntu2404_build:latest"
17+
default: "ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps"
1818
build_ref:
1919
type: string
2020
required: false
@@ -70,7 +70,7 @@ on:
7070
build_image:
7171
type: choice
7272
options:
73-
- "ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build"
73+
- 'ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest'
7474
cc:
7575
type: choice
7676
options:
@@ -252,3 +252,37 @@ jobs:
252252
name: sycl_linux_${{ inputs.build_artifact_suffix }}
253253
path: ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
254254
retention-days: ${{ inputs.retention-days }}
255+
256+
- name: Copy toolchain
257+
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
258+
# We must have the compiler in the same location as it will be in the E2E
259+
# run-tests job.
260+
run: cp -r $GITHUB_WORKSPACE/build/install $GITHUB_WORKSPACE/toolchain
261+
262+
- name: Source OneAPI TBB vars.sh
263+
shell: bash
264+
run: |
265+
# https://github.com/actions/runner/issues/1964 prevents us from using
266+
# the ENTRYPOINT in the image.
267+
env | sort > env_before
268+
if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then
269+
source /runtimes/oneapi-tbb/env/vars.sh;
270+
elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then
271+
source /opt/runtimes/oneapi-tbb/env/vars.sh;
272+
else
273+
echo "no TBB vars in /opt/runtimes or /runtimes";
274+
fi
275+
env | sort > env_after
276+
comm -13 env_before env_after >> $GITHUB_ENV
277+
rm env_before env_after
278+
279+
- name: Build E2E tests
280+
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
281+
uses: ./devops/actions/run-tests/e2e
282+
with:
283+
ref: ${{ inputs.ref || github.sha }}
284+
merge_ref: ${{ inputs.merge_ref }}
285+
e2e_testing_mode: build-only
286+
target_devices: all
287+
artifact_suffix: default
288+
cxx_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++

.github/workflows/sycl-linux-precommit.yml

+2-17
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
build_artifact_suffix: "default"
4747
build_cache_suffix: "default"
4848
# Docker image has last nightly pre-installed and added to the PATH
49-
build_image: "ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build"
49+
build_image: "ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest"
5050
cc: clang
5151
cxx: clang++
5252
changes: ${{ needs.detect_changes.outputs.filters }}
@@ -73,23 +73,8 @@ jobs:
7373
echo 'arc_tests="Matrix/"' >> "$GITHUB_OUTPUT"
7474
fi
7575
76-
build_e2e_tests:
77-
needs: [build]
78-
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
79-
uses: ./.github/workflows/sycl-linux-run-tests.yml
80-
with:
81-
name: Build e2e tests
82-
runner: '["Linux", "build"]'
83-
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps
84-
image_options: -u 1001
85-
ref: ${{ github.sha }}
86-
merge_ref: ''
87-
sycl_toolchain_artifact: sycl_linux_default
88-
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
89-
sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }}
90-
e2e_testing_mode: 'build-only'
9176
run_prebuilt_e2e_tests:
92-
needs: [build, build_e2e_tests]
77+
needs: [build]
9378
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
9479
strategy:
9580
fail-fast: false

devops/actions/run-tests/e2e/action.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ inputs:
1919
required: false
2020
retention-days:
2121
required: false
22+
cxx_compiler:
23+
required: false
2224

2325

2426
runs:
@@ -58,7 +60,7 @@ runs:
5860
if: inputs.e2e_binaries_artifact == ''
5961
shell: bash
6062
run: |
61-
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 }}
63+
cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DCMAKE_CXX_COMPILER="${{ inputs.cxx_compiler || '$(which clang++)'}}" -DLLVM_LIT="$PWD/llvm/llvm/utils/lit/lit.py" ${{ steps.cmake_opts.outputs.opts }}
6264
- name: SYCL End-to-end tests
6365
shell: bash {0}
6466
env:

0 commit comments

Comments
 (0)