Skip to content

Commit 50502a9

Browse files
authored
Merge pull request #1261 from wlemkows/e2e-cuda-pr
[CI] Enable Cuda/OpenCL e2e on PR comment
2 parents a59e60f + 0bebbea commit 50502a9

File tree

3 files changed

+112
-7
lines changed

3 files changed

+112
-7
lines changed

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

+56-7
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,56 @@
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+
description: Adapter name
11+
type: string
12+
required: true
13+
str_name: Formatted adapter name
14+
description:
15+
type: string
16+
required: true
17+
prefix:
18+
description: Prefix for cmake parameter
19+
type: string
20+
required: true
21+
config:
22+
description: Params for sycl configuration
23+
type: string
24+
required: true
25+
unit:
26+
description: Test unit (cpu/gpu)
27+
type: string
28+
required: true
29+
runner_tag:
30+
description: Tag defifned for the runner
31+
type: string
32+
required: true
733

834
permissions:
935
contents: read
36+
pull-requests: write
1037

1138
jobs:
1239
e2e-build-hw:
1340
name: Build SYCL, UR, run E2E
1441
strategy:
1542
matrix:
1643
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"}
44+
{name: "${{inputs.name}}",
45+
str_name: "${{inputs.str_name}}",
46+
prefix: "${{inputs.prefix}}",
47+
config: "${{inputs.config}}",
48+
unit: "${{inputs.unit}}"}
1949
]
2050
build_type: [Release]
2151
compiler: [{c: clang, cxx: clang++}]
2252

23-
runs-on: ${{matrix.adapter.name}}
53+
runs-on: ${{inputs.runner_tag}}
2454

2555
steps:
2656
# Workspace on self-hosted runners is not cleaned automatically.
@@ -31,6 +61,25 @@ jobs:
3161
ls -la ./
3262
rm -rf ./* || true
3363
64+
- uses: xt0rted/pull-request-comment-branch@d97294d304604fa98a2600a6e2f916a84b596dc7 # v2.0.0
65+
id: comment-branch
66+
67+
- name: Add comment to PR
68+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
69+
if: always()
70+
with:
71+
script: |
72+
const adapter = '${{ matrix.adapter.name }}';
73+
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
74+
const body = `E2E ${adapter} build: \n${url}`;
75+
76+
github.rest.issues.createComment({
77+
issue_number: context.issue.number,
78+
owner: context.repo.owner,
79+
repo: context.repo.repo,
80+
body: body
81+
})
82+
3483
- name: Checkout UR
3584
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3685
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)