-
Notifications
You must be signed in to change notification settings - Fork 823
262 lines (246 loc) · 9.46 KB
/
sycl-windows-build.yml
File metadata and controls
262 lines (246 loc) · 9.46 KB
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
name: Reusable SYCL Windows build workflow
on:
workflow_call:
inputs:
cxx:
type: string
required: false
default: "cl"
build_cache_suffix:
type: string
required: false
default: "default"
ref:
type: string
required: False
build_configure_extra_args:
type: string
required: false
build_target:
type: string
required: false
default: sycl-toolchain
changes:
type: string
description: 'Filter matches for the changed files in the PR'
default: '[llvm, clang, sycl, llvm_spirv, xptifw, libclc]'
required: false
# Artifacts:
retention-days:
description: 'Artifacts retention period'
type: string
default: 3
toolchain_artifact_filename:
type: string
default: llvm_sycl.tar.gz
release_toolchain_artifact:
type: string
required: false
description: |
If provided, create an additional toolchain artifact without utilities
used for testing in it. File name of the archive is the same as in the
`toolchain_artifact` above.
e2e_binaries_artifact:
type: string
required: false
outputs:
build_conclusion:
value: ${{ jobs.build.outputs.build_conclusion }}
toolchain_artifact_filename:
value: ${{ inputs.toolchain_artifact_filename }}
workflow_dispatch:
inputs:
changes:
description: 'Filter matches for the changed files in the PR'
type: choice
options:
- "[]"
- '[sycl]'
- '[llvm, clang, sycl, llvm_spirv, xptifw, libclc]'
build_cache_suffix:
type: choice
options:
- "default"
build_configure_extra_args:
type: string
required: false
build_target:
type: choice
options:
- "sycl-toolchain"
- "all"
toolchain_artifact_filename:
type: choice
options:
- 'llvm_sycl.tar.gz'
default:
retention-days:
type: choice
options:
- 3
cxx:
type: choice
options:
- cl
- icx
permissions: read-all
jobs:
build:
name: Build + LIT
runs-on: [Windows, build]
environment: WindowsCILock
outputs:
build_conclusion: ${{ steps.build.conclusion }}
steps:
- name: Detect hung tests
if: always()
shell: powershell
run: |
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" -Headers @{Authorization = "Bearer ${{ github.token }}"}
powershell.exe -File windows_detect_hung_tests.ps1
$exitCode = $LASTEXITCODE
Remove-Item -Path "windows_detect_hung_tests.ps1"
exit $exitCode
- uses: actions/checkout@v5
with:
sparse-checkout: |
devops/actions
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
with:
arch: amd64
- name: Setup oneAPI env
uses: ./devops/actions/setup_windows_oneapi_env
if: ${{ !cancelled() && inputs.cxx == 'icx' }}
- name: Set env
run: |
git config --system core.longpaths true
git config --global core.autocrlf false
echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "CCACHE_DIR=D:\github\_work\cache\${{ inputs.build_cache_suffix }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CCACHE_MAXSIZE=10G" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "LIT_OPTS='-j$env:NUMBER_OF_PROCESSORS $LIT_OPTS'" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Register cleanup after job is finished
uses: ./devops/actions/cleanup
- uses: ./devops/actions/cached_checkout
with:
path: src
ref: ${{ inputs.ref || github.sha }}
cache_path: "D:\\\\github\\\\_work\\\\repo_cache\\\\"
- name: Configure
shell: cmd
env:
ARGS: ${{ inputs.build_configure_extra_args }}
# TODO switch to clang-cl and lld when this is fixed https://github.com/oneapi-src/level-zero/issues/83
run: |
mkdir build
mkdir install
IF NOT EXIST D:\github\_work\cache MKDIR D:\github\_work\cache
IF NOT EXIST D:\github\_work\cache\${{inputs.build_cache_suffix}} MKDIR D:\github\_work\cache\${{inputs.build_cache_suffix}}
python.exe src/buildbot/configure.py -o build ^
--ci-defaults --use-zstd %ARGS% ^
"-DCMAKE_C_COMPILER=${{inputs.cxx}}" ^
"-DCMAKE_CXX_COMPILER=${{inputs.cxx}}" ^
"-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache ^
-DCMAKE_C_COMPILER_LAUNCHER=ccache ^
-DLLVM_INSTALL_UTILS=ON
- name: Build
id: build
shell: bash
run: |
cmake --build build --target ${{ inputs.build_target }}
- run: build/bin/clang++ --version
- name: check-llvm
if: ${{ !cancelled() && contains(inputs.changes, 'llvm') }}
shell: bash
run: |
cmake --build build --target check-llvm
- name: check-clang
if: ${{ !cancelled() && contains(inputs.changes, 'clang') }}
run: |
cmake --build build --target check-clang
- name: check-sycl
if: ${{ !cancelled() && contains(inputs.changes, 'sycl') }}
shell: bash
run: |
cmake --build build --target check-sycl
- name: check-sycl-unittests
if: ${{ !cancelled() && contains(inputs.changes, 'sycl') }}
run: |
cmake --build build --target check-sycl-unittests
- name: check-llvm-spirv
if: ${{ !cancelled() && contains(inputs.changes, 'llvm_spirv') }}
run: |
cmake --build build --target check-llvm-spirv
- name: check-xptifw
if: ${{ !cancelled() && contains(inputs.changes, 'xptifw') }}
run: |
cmake --build build --target check-xptifw
- name: Generate/diff new ABI symbols
if: ${{ !cancelled() && contains(inputs.changes, 'sycl') }}
shell: bash
run: |
LLVM_BIN_PATH="build/bin" python.exe src/sycl/tools/abi_check.py --mode dump_symbols --output build/new_sycl_symbols_windows.dump build/bin/sycl?.dll
diff -Naur src/sycl/test/abi/sycl_symbols_windows.dump build/new_sycl_symbols_windows.dump || true
- name: Upload new ABI symbols
if: ${{ !cancelled() && contains(inputs.changes, 'sycl') }}
uses: actions/upload-artifact@v5
with:
name: sycl_windows_abi_symbols
path: build/new_sycl_symbols_windows.dump
retention-days: ${{ inputs.retention-days }}
- name: Install sycl-toolchain
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: |
cmake --build build --target deploy-sycl-toolchain
- name: Pack toolchain release
if: ${{ !cancelled() && steps.build.conclusion == 'success' && inputs.release_toolchain_artifact != '' }}
run: tar -czf ${{ inputs.toolchain_artifact_filename }} -C install .
- name: Upload toolchain release
if: ${{ !cancelled() && steps.build.conclusion == 'success' && inputs.release_toolchain_artifact != '' }}
uses: actions/upload-artifact@v5
with:
name: ${{ inputs.release_toolchain_artifact }}
path: ${{ inputs.toolchain_artifact_filename }}
retention-days: ${{ inputs.retention-days }}
- name: Install utilities
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
shell: bash
run: |
cmake --build $GITHUB_WORKSPACE/build --target install-sycl-test-utilities
- name: Pack toolchain
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
shell: bash
run: |
tar -czf ${{ inputs.toolchain_artifact_filename }} -C install .
- name: Upload toolchain
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
uses: actions/upload-artifact@v5
with:
name: sycl_windows_default
path: ${{ inputs.toolchain_artifact_filename }}
retention-days: ${{ inputs.retention-days }}
- name: Setup SYCL toolchain
if: ${{ !cancelled() && steps.build.conclusion == 'success' }}
run: |
echo "PATH=$env:GITHUB_WORKSPACE\\install\\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "LIB=$env:GITHUB_WORKSPACE\\install\\lib;$env:LIB" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build E2E tests
if: ${{ inputs.e2e_binaries_artifact && !cancelled() && steps.build.conclusion == 'success' }}
uses: ./devops/actions/run-tests/windows/e2e
with:
ref: ${{ inputs.ref || github.sha }}
testing_mode: build-only
target_devices: all
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}
extra_lit_opts: --param sycl_build_targets="spir"
cxx: ${{ inputs.cxx }}
- name: Detect hung tests
if: always()
shell: powershell
run: |
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl/devops/scripts/windows_detect_hung_tests.ps1" -OutFile "windows_detect_hung_tests.ps1" -Headers @{Authorization = "Bearer ${{ github.token }}"}
powershell.exe -File windows_detect_hung_tests.ps1
$exitCode = $LASTEXITCODE
Remove-Item -Path "windows_detect_hung_tests.ps1"
exit $exitCode