Skip to content

Commit 7627337

Browse files
authored
Merge pull request #1712 from lukaszstolarczuk/update-workflows
[CI] Run E2E on PR
2 parents 8e47ab5 + 3f60e4e commit 7627337

File tree

5 files changed

+54
-68
lines changed

5 files changed

+54
-68
lines changed

.github/workflows/cmake.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,41 +161,60 @@ jobs:
161161
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "fuzz-short" --verbose
162162

163163
level-zero:
164-
if: github.repository == 'oneapi-src/unified-runtime'
165164
name: Level Zero
166165
uses: ./.github/workflows/build-hw-reusable.yml
167166
with:
168167
name: L0
169168

170169
opencl:
171-
if: github.repository == 'oneapi-src/unified-runtime'
172170
name: OpenCL
173171
uses: ./.github/workflows/build-hw-reusable.yml
174172
with:
175173
name: OPENCL
176174
platform: "Intel(R) OpenCL"
177175

178176
cuda:
179-
if: github.repository == 'oneapi-src/unified-runtime'
180177
name: CUDA
181178
uses: ./.github/workflows/build-hw-reusable.yml
182179
with:
183180
name: CUDA
184181

185182
hip:
186-
if: github.repository == 'oneapi-src/unified-runtime'
187183
name: HIP
188184
uses: ./.github/workflows/build-hw-reusable.yml
189185
with:
190186
name: HIP
191187

192188
native-cpu:
193-
if: github.repository == 'oneapi-src/unified-runtime'
194189
name: Native CPU
195190
uses: ./.github/workflows/build-hw-reusable.yml
196191
with:
197192
name: NATIVE_CPU
198193

194+
e2e-level-zero:
195+
name: E2E L0
196+
permissions:
197+
contents: read
198+
pull-requests: write
199+
needs: [ubuntu-build, level-zero]
200+
uses: ./.github/workflows/e2e_level_zero.yml
201+
202+
e2e-opencl:
203+
name: E2E OpenCL
204+
permissions:
205+
contents: read
206+
pull-requests: write
207+
needs: [ubuntu-build, opencl]
208+
uses: ./.github/workflows/e2e_opencl.yml
209+
210+
e2e-cuda:
211+
name: E2E CUDA
212+
permissions:
213+
contents: read
214+
pull-requests: write
215+
needs: [ubuntu-build, cuda]
216+
uses: ./.github/workflows/e2e_cuda.yml
217+
199218
windows-build:
200219
name: Build - Windows
201220
strategy:
@@ -262,7 +281,6 @@ jobs:
262281
working-directory: ${{github.workspace}}/build
263282
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"
264283

265-
266284
macos-build:
267285
name: Build - MacOS
268286
strategy:

.github/workflows/e2e_core.yml

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ on:
3030
description: Tag defifned for the runner
3131
type: string
3232
required: true
33-
trigger:
34-
description: Type of workflow trigger
35-
type: string
36-
required: true
3733
xfail:
3834
description: Allow test failures
3935
type: string
@@ -53,12 +49,33 @@ on:
5349

5450
permissions:
5551
contents: read
56-
pull-requests: write
5752

5853
jobs:
54+
changed-files:
55+
name: Check for changed files
56+
runs-on: ubuntu-22.04
57+
outputs:
58+
any_changed: ${{ steps.get-changed.outputs.any_changed }}
59+
steps:
60+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
61+
- name: Get changed files
62+
id: get-changed
63+
uses: tj-actions/changed-files@d6babd6899969df1a11d14c368283ea4436bca78 # v44.5.2
64+
with:
65+
files: |
66+
source/adapters/${{inputs.str_name}}/**
67+
5968
e2e-build-hw:
60-
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks will not have the HW
69+
# We want to run the job only if there are changes in the specific adapter
70+
if: needs.changed-files.outputs.any_changed == 'true'
6171
name: Build SYCL, UR, run E2E
72+
needs: changed-files
73+
permissions:
74+
contents: read
75+
pull-requests: write
76+
77+
# Allow failures, since SYCL tests and API may be not stable
78+
continue-on-error: true
6279
strategy:
6380
matrix:
6481
adapter: [
@@ -83,39 +100,11 @@ jobs:
83100
ls -la ./
84101
rm -rf ./* || true
85102
86-
- name: Add comment to PR
87-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
88-
if: ${{ always() && inputs.trigger != 'schedule' }}
89-
with:
90-
script: |
91-
const adapter = '${{ matrix.adapter.name }}';
92-
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
93-
const body = `E2E ${adapter} build: \n${url}`;
94-
95-
github.rest.issues.createComment({
96-
issue_number: context.issue.number,
97-
owner: context.repo.owner,
98-
repo: context.repo.repo,
99-
body: body
100-
})
101-
102103
- name: Checkout UR
103104
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
104105
with:
105106
path: ur-repo
106107

107-
# On issue_comment trigger (for PRs) we need to fetch special ref for
108-
# proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
109-
- name: Fetch PR's merge commit
110-
if: ${{ inputs.trigger != 'schedule' }}
111-
working-directory: ${{github.workspace}}/ur-repo
112-
env:
113-
PR_NO: ${{github.event.issue.number}}
114-
run: |
115-
git fetch -- https://github.com/${{github.repository}} +refs/pull/${PR_NO}/*:refs/remotes/origin/pr/${PR_NO}/*
116-
git checkout origin/pr/${PR_NO}/merge
117-
git rev-parse origin/pr/${PR_NO}/merge
118-
119108
- name: Checkout SYCL
120109
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
121110
with:
@@ -190,7 +179,7 @@ jobs:
190179

191180
- name: Add comment to PR
192181
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
193-
if: ${{ always() && inputs.trigger != 'schedule' }}
182+
if: ${{ always() }}
194183
with:
195184
script: |
196185
const adapter = '${{ matrix.adapter.name }}';

.github/workflows/e2e_cuda.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
11
name: E2E Cuda
22

33
on:
4-
schedule:
5-
# Run every day at 23:00 UTC
6-
- cron: '0 23 * * *'
7-
issue_comment:
8-
types: [created, edited]
4+
workflow_call:
95

106
permissions:
117
contents: read
128
pull-requests: write
139

1410
jobs:
1511
e2e-build-hw:
16-
# trigger only if PR comment contains "e2e-cuda"
17-
if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/e2e-cuda')) || (github.event_name == 'schedule') }}
12+
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks will not have the HW
1813
name: Start e2e job
1914
# use core flow, run it with cuda specific parameters
2015
uses: ./.github/workflows/e2e_core.yml
21-
# parameters that we pass to the core flow
2216
with:
2317
name: "CUDA"
2418
runner_tag: "CUDA_E2E"
2519
str_name: "cuda"
2620
prefix: "ext_oneapi_"
2721
config: "--cuda"
2822
unit: "gpu"
29-
trigger: "${{github.event_name}}"

.github/workflows/e2e_level_zero.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
11
name: E2E Level Zero
22

33
on:
4-
schedule:
5-
# Run every day at 23:00 UTC
6-
- cron: '0 23 * * *'
7-
issue_comment:
8-
types: [created, edited]
4+
workflow_call:
95

106
permissions:
117
contents: read
128
pull-requests: write
139

1410
jobs:
1511
e2e-build-hw:
16-
# trigger only if PR comment contains "e2e-level-zero"
17-
if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/e2e-level-zero')) || (github.event_name == 'schedule') }}
12+
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks will not have the HW
1813
name: Start e2e job
1914
# use core flow, run it with L0 specific parameters
2015
uses: ./.github/workflows/e2e_core.yml
21-
# parameters that we pass to the core flow
2216
with:
2317
name: "L0"
2418
runner_tag: "L0_E2E"
2519
str_name: "level_zero"
2620
prefix: "ext_oneapi_"
2721
config: ""
2822
unit: "gpu"
29-
trigger: "${{github.event_name}}"
3023
# Failing tests
3124
xfail: "ESIMD/preemption.cpp;syclcompat/atomic/atomic_class.cpp;ProgramManager/uneven_kernel_split.cpp;Plugin/level_zero_ext_intel_queue_index.cpp;Plugin/level_zero_ext_intel_cslice.cpp;Matrix/joint_matrix_rowmajorA_rowmajorB.cpp;Matrix/element_wise_ops.cpp;Matrix/element_wise_all_ops.cpp;Matrix/SG32/element_wise_all_ops.cpp"
3225
# Flaky tests

.github/workflows/e2e_opencl.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
11
name: E2E OpenCL
22

33
on:
4-
schedule:
5-
# Run every day at 23:00 UTC
6-
- cron: '0 23 * * *'
7-
issue_comment:
8-
types: [created, edited]
4+
workflow_call:
95

106
permissions:
117
contents: read
128
pull-requests: write
139

1410
jobs:
1511
e2e-build-hw:
16-
# trigger only if PR comment contains "e2e-opencl"
17-
if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/e2e-opencl')) || (github.event_name == 'schedule') }}
12+
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks will not have the HW
1813
name: Start e2e job
1914
# use core flow, run it with OpenCL specific parameters
2015
uses: ./.github/workflows/e2e_core.yml
21-
# parameters that we pass to the core flow
2216
with:
2317
name: "OPENCL"
2418
runner_tag: "OPENCL"
2519
str_name: "opencl"
2620
prefix: ""
2721
config: ""
2822
unit: "cpu"
29-
trigger: "${{github.event_name}}"

0 commit comments

Comments
 (0)