Skip to content

Commit 4a929a6

Browse files
aelovikov-intelmdtoguchi
authored andcommitted
[CI] Switch pre-commit to a new scheme (intel#10720)
Use pull_request trigger (instead of pull_request_target) for everything except AWS CUDA E2E testing. The latter has to go to a separate workflow (workflow_run) in order to have access to the AWS EC key kept as a github secret. As part of the changes, I also stopped using matrix generator for the pre-commit task. Instead, the matrix is written directly inside the task's .yml file. The only minor difference in the behavior is that driver installation happens on an image with previous driver installed, not on a system without any driver.
1 parent 3cf7ab4 commit 4a929a6

File tree

3 files changed

+56
-134
lines changed

3 files changed

+56
-134
lines changed

.github/workflows/sycl_exp_precommit.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

.github/workflows/sycl_precommit_aws.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
name: E2E on AWS CUDA
2+
# We have to keep pre-commit AWS CUDA testing in a separate workflow because we
3+
# need access to AWS secret and that isn't available on pull_request jobs for
4+
# PRs from forks. And github's "require approval for all outside collaborators"
5+
# is bypassed on pull_request_target.
6+
#
7+
# Also, we use commit status and not check suite/run (which, in theory, is more
8+
# powerful) due to https://github.com/orgs/community/discussions/24616.
29

310
on:
411
workflow_run:
5-
workflows: [SYCL Experimental Pre-Commit]
12+
workflows: [SYCL Pre Commit on Linux]
613
types:
714
- completed
815

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: SYCL Pre Commit on Linux
22

33
on:
4-
pull_request_target:
4+
# We rely on "Fork pull request workflows from outside collaborators" -
5+
# "Require approval for all outside collaborators" at
6+
# https://github.com/intel/llvm/settings/actions for security.
7+
pull_request:
58
branches:
69
- sycl
710
- sycl-devops-pr/**
8-
- llvmspirv_pulldown
911
# Do not run builds if changes are only in the following locations
1012
paths-ignore:
1113
- '.github/ISSUE_TEMPLATE/**'
@@ -15,32 +17,19 @@ on:
1517
- 'clang/docs/**'
1618
- '**.md'
1719
- '**.rst'
18-
# Changes in CI won't have any effect with pull_request_target
19-
- '.github/workflows'
20-
# For CI-related files we explicitly skip all the jobs below even if there
21-
# were other (non-ignored) files modified in this PR.
22-
- 'devops/*/**'
23-
24-
permissions:
25-
contents: read
2620

2721
jobs:
2822
detect_changes:
2923
uses: ./.github/workflows/sycl_detect_changes.yml
3024

3125
lint:
32-
needs: [detect_changes]
33-
if: |
34-
github.event.pull_request.head.repo.full_name == 'intel/llvm' ||
35-
!contains(needs.detect_changes.outputs.filters, 'ci')
3626
runs-on: [Linux, build]
3727
container:
3828
image: ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:no-drivers
3929
options: -u 1001:1001
4030
steps:
4131
- uses: actions/checkout@v3
4232
with:
43-
ref: ${{ github.base_ref }}
4433
sparse-checkout: |
4534
devops/actions/cached_checkout
4635
devops/actions/clang-format
@@ -61,36 +50,55 @@ jobs:
6150
with:
6251
path: src
6352

64-
# This job generates matrix of tests for SYCL End-to-End tests
65-
test_matrix:
66-
needs: [detect_changes]
67-
if: |
68-
github.event.pull_request.head.repo.full_name == 'intel/llvm' ||
69-
!contains(needs.detect_changes.outputs.filters, 'ci')
70-
name: Generate Test Matrix
71-
uses: ./.github/workflows/sycl_gen_test_matrix.yml
72-
with:
73-
ref: ${{ github.event.pull_request.head.sha }}
74-
lts_config: "hip_amdgpu;lin_intel;esimd_emu;cuda_aws"
75-
76-
linux_default:
77-
name: Linux
78-
# Only build and test patches, that have passed all linter checks, because
79-
# the next commit is likely to be a follow-up on that job.
80-
needs: [lint, test_matrix, detect_changes]
53+
build:
54+
needs: [lint, detect_changes]
8155
if: |
8256
always()
8357
&& (success() || contains(github.event.pull_request.labels.*.name, 'ignore-lint'))
84-
&& (github.event.pull_request.head.repo.full_name == 'intel/llvm'
85-
|| !contains(needs.detect_changes.outputs.filters, 'ci'))
86-
uses: ./.github/workflows/sycl_linux_build_and_test.yml
87-
secrets: inherit
58+
uses: ./.github/workflows/sycl_linux_build.yml
8859
with:
89-
build_ref: ${{ github.event.pull_request.head.sha }}
90-
merge_ref: ${{ github.event.pull_request.base.sha }}
60+
build_ref: ${{ github.sha }}
61+
merge_ref: ''
9162
build_cache_root: "/__w/"
9263
build_artifact_suffix: "default"
9364
build_cache_suffix: "default"
94-
lts_matrix: ${{ needs.test_matrix.outputs.lts_lx_matrix }}
95-
lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }}
9665
changes: ${{ needs.detect_changes.outputs.filters }}
66+
67+
test:
68+
needs: [build, detect_changes]
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
include:
73+
- name: ESIMD Emu
74+
runner: '["Linux", "x86-cpu"]'
75+
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
76+
image_options: -u 1001
77+
target_devices: ext_intel_esimd_emulator:gpu
78+
- name: AMD/HIP
79+
runner: '["Linux", "amdgpu"]'
80+
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
81+
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
82+
target_devices: ext_oneapi_hip:gpu
83+
- name: Intel
84+
runner: '["Linux", "gen12"]'
85+
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
86+
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
87+
target_devices: ext_oneapi_level_zero:gpu;opencl:gpu;opencl:cpu
88+
reset_gpu: ${{ contains(needs.detect_changes.outputs.filters, 'drivers') }}
89+
uses: ./.github/workflows/sycl_linux_run_tests.yml
90+
with:
91+
name: ${{ matrix.name }}
92+
runner: ${{ matrix. runner }}
93+
image: ${{ matrix.image }}
94+
image_options: ${{ matrix.image_options }}
95+
target_devices: ${{ matrix.target_devices }}
96+
reset_gpu: ${{ matrix.reset_gpu }}
97+
98+
ref: ${{ github.sha }}
99+
merge_ref: ''
100+
101+
sycl_toolchain_artifact: sycl_linux_default
102+
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
103+
sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }}
104+

0 commit comments

Comments
 (0)