forked from oneapi-src/unified-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
184 lines (163 loc) · 6.19 KB
/
e2e_core.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: E2E build & run
on:
# this workflow can by only triggered by other workflows
# for example by: e2e_cuda.yml or e2e_opencl.yml
workflow_call:
# acceptable input from adapter-specific workflows
inputs:
name:
description: Adapter name
type: string
required: true
str_name:
description: Formatted adapter name
type: string
required: true
prefix:
description: Prefix for cmake parameter
type: string
required: true
config:
description: Params for sycl configuration
type: string
required: true
unit:
description: Test unit (cpu/gpu)
type: string
required: true
runner_tag:
description: Tag defifned for the runner
type: string
required: true
trigger:
description: Type of workflow trigger
type: string
required: true
permissions:
contents: read
pull-requests: write
jobs:
e2e-build-hw:
if: github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks will not have the HW
name: Build SYCL, UR, run E2E
strategy:
matrix:
adapter: [
{name: "${{inputs.name}}",
str_name: "${{inputs.str_name}}",
prefix: "${{inputs.prefix}}",
config: "${{inputs.config}}",
unit: "${{inputs.unit}}"}
]
build_type: [Release]
compiler: [{c: clang, cxx: clang++}]
runs-on: ${{inputs.runner_tag}}
steps:
# Workspace on self-hosted runners is not cleaned automatically.
# We have to delete the files created outside of using actions.
- name: Cleanup self-hosted workspace
if: always()
run: |
ls -la ./
rm -rf ./* || true
- name: Add comment to PR
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ always() && inputs.trigger != 'schedule' }}
with:
script: |
const adapter = '${{ matrix.adapter.name }}';
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
const body = `E2E ${adapter} build: \n${url}`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
})
- name: Checkout UR
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: ur-repo
# On issue_comment trigger (for PRs) we need to fetch special ref for
# proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
- name: Fetch PR's merge commit
if: ${{ inputs.trigger != 'schedule' }}
working-directory: ${{github.workspace}}/ur-repo
env:
PR_NO: ${{github.event.issue.number}}
run: |
git fetch -- https://github.com/${{github.repository}} +refs/pull/${PR_NO}/*:refs/remotes/origin/pr/${PR_NO}/*
git checkout origin/pr/${PR_NO}/merge
git rev-parse origin/pr/${PR_NO}/merge
- name: Checkout SYCL
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: intel/llvm
ref: sycl
path: sycl-repo
- name: Set CUDA env vars
if: matrix.adapter.name == 'CUDA'
run: |
echo "CUDA_LIB_PATH=/usr/local/cuda/lib64/stubs" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Run pre setup
run: |
source /opt/intel/oneapi/setvars.sh --force
sycl-ls
- name: Configure SYCL
run: >
python3 sycl-repo/buildbot/configure.py
-t ${{matrix.build_type}}
-o ${{github.workspace}}/sycl_build
--cmake-gen "Ninja"
--ci-defaults ${{matrix.adapter.config}}
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
--cmake-opt="-DSYCL_PI_TESTS=OFF"
--cmake-opt="-DSYCL_PI_UR_USE_FETCH_CONTENT=OFF"
--cmake-opt="-DSYCL_PI_UR_SOURCE_DIR=${{github.workspace}}/ur-repo/"
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build SYCL
run: cmake --build ${{github.workspace}}/sycl_build -j
- name: Run check-sycl
# Remove after fixing SYCL test :: abi/layout_handler.cpp
# This issue does not affect further execution of e2e with UR.
continue-on-error: true
run: cmake --build ${{github.workspace}}/sycl_build --target check-sycl -j6
- name: Set additional env. vars
run: |
echo "${{github.workspace}}/sycl_build/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=${{github.workspace}}/sycl_build/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
# Running (newly built) sycl-ls sets up some extra variables
- name: Setup SYCL variables
run: |
which clang++ sycl-ls
SYCL_PI_TRACE=-1 sycl-ls
- name: Build e2e tests
run: >
cmake
-GNinja
-B ${{github.workspace}}/build-e2e/
-S ${{github.workspace}}/sycl-repo/sycl/test-e2e/
-DSYCL_TEST_E2E_TARGETS="${{matrix.adapter.prefix}}${{matrix.adapter.str_name}}:${{matrix.adapter.unit}}"
-DCMAKE_CXX_COMPILER="$(which clang++)"
-DLLVM_LIT="${{github.workspace}}/sycl-repo/llvm/utils/lit/lit.py"
- name: Run e2e tests
id: tests
run: ninja -C build-e2e check-sycl-e2e
- name: Add comment to PR
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
if: ${{ always() && inputs.trigger != 'schedule' }}
with:
script: |
const adapter = '${{ matrix.adapter.name }}';
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
const test_status = '${{ steps.tests.outcome }}';
const job_status = '${{ job.status }}';
const body = `E2E ${adapter} build:\n${url}\nJob status: ${job_status}. Test status: ${test_status}`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
})