Skip to content

Commit f4b36f4

Browse files
committed
[CI] Enable Cuda test-e2e per PR
1 parent 4814e71 commit f4b36f4

File tree

3 files changed

+106
-7
lines changed

3 files changed

+106
-7
lines changed

.github/workflows/e2e_nightly.yml renamed to .github/workflows/e2e_core.yml

+50-7
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,50 @@
1-
name: E2E Nightly
1+
name: E2E build & run
22

33
on:
4-
schedule:
5-
# Run every day at 23:00 UTC
6-
- cron: '0 23 * * *'
4+
# this workflow can by only triggered by other workflows
5+
# for example by: e2e_cuda.yml or e2e_opencl.yml
6+
workflow_call:
7+
# acceptable input from adapter-specific workflows
8+
inputs:
9+
name:
10+
type: string
11+
required: true
12+
str_name:
13+
type: string
14+
required: true
15+
prefix:
16+
type: string
17+
required: true
18+
config:
19+
type: string
20+
required: true
21+
unit:
22+
type: string
23+
required: true
24+
runner_tag:
25+
type: string
26+
required: true
727

828
permissions:
929
contents: read
30+
pull-requests: write
1031

1132
jobs:
1233
e2e-build-hw:
1334
name: Build SYCL, UR, run E2E
1435
strategy:
1536
matrix:
1637
adapter: [
17-
{name: CUDA, str_name: cuda, prefix: "ext_oneapi_", config: "--cuda --hip", unit: "gpu"},
18-
{name: OPENCL, str_name: opencl, prefix: "", config: "", unit: "cpu"}
38+
{name: "${{inputs.name}}",
39+
str_name: "${{inputs.str_name}}",
40+
prefix: "${{inputs.prefix}}",
41+
config: "${{inputs.config}}",
42+
unit: "${{inputs.unit}}"}
1943
]
2044
build_type: [Release]
2145
compiler: [{c: clang, cxx: clang++}]
2246

23-
runs-on: ${{matrix.adapter.name}}
47+
runs-on: ${{inputs.runner_tag}}
2448

2549
steps:
2650
# Workspace on self-hosted runners is not cleaned automatically.
@@ -31,6 +55,25 @@ jobs:
3155
ls -la ./
3256
rm -rf ./* || true
3357
58+
- uses: xt0rted/pull-request-comment-branch@d97294d304604fa98a2600a6e2f916a84b596dc7 # v2.0.0
59+
id: comment-branch
60+
61+
- name: Add comment to PR
62+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
63+
if: always()
64+
with:
65+
script: |
66+
const adapter = '${{ matrix.adapter.name }}';
67+
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
68+
const body = `E2E ${adapter} build: \n${url}`;
69+
70+
github.rest.issues.createComment({
71+
issue_number: context.issue.number,
72+
owner: context.repo.owner,
73+
repo: context.repo.repo,
74+
body: body
75+
})
76+
3477
- name: Checkout UR
3578
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3679
with:

.github/workflows/e2e_cuda.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: E2E Cuda
2+
3+
on:
4+
schedule:
5+
# Run every day at 23:00 UTC
6+
- cron: '0 23 * * *'
7+
issue_comment:
8+
types: [created, edited]
9+
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
14+
jobs:
15+
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') }}
18+
name: Start e2e job
19+
# use core flow, run it with cuda specific parameters
20+
uses: ./.github/workflows/e2e_core.yml
21+
# parameters that we pass to the core flow
22+
with:
23+
name: "CUDA"
24+
runner_tag: "CUDA_E2E"
25+
str_name: "cuda"
26+
prefix: "ext_oneapi_"
27+
config: "--cuda"
28+
unit: "gpu"

.github/workflows/e2e_opencl.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: E2E OpenCL
2+
3+
on:
4+
schedule:
5+
# Run every day at 23:00 UTC
6+
- cron: '0 23 * * *'
7+
issue_comment:
8+
types: [created, edited]
9+
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
14+
jobs:
15+
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') }}
18+
name: Start e2e job
19+
# use core flow, run it with OpenCL specific parameters
20+
uses: ./.github/workflows/e2e_core.yml
21+
# parameters that we pass to the core flow
22+
with:
23+
name: "OPENCL"
24+
runner_tag: "OPENCL"
25+
str_name: "opencl"
26+
prefix: ""
27+
config: ""
28+
unit: "cpu"

0 commit comments

Comments
 (0)