forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (151 loc) · 5.52 KB
/
sycl-windows-build.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
name: Reusable SYCL Windows build workflow
on:
workflow_call:
inputs:
build_cache_suffix:
type: string
required: false
default: "default"
build_ref:
type: string
required: false
changes:
type: string
description: 'Filter matches for the changed files in the PR'
default: '[llvm, clang, sycl, llvm_spirv, xptifw, libclc, libdevice]'
required: false
artifact_archive_name:
type: string
default: llvm_sycl.tar.gz
retention-days:
description: 'Artifacts retention period'
type: string
default: 3
outputs:
build_conclusion:
value: ${{ jobs.build.outputs.build_conclusion }}
artifact_archive_name:
value: ${{ inputs.artifact_archive_name }}
workflow_dispatch:
inputs:
changes:
description: 'Filter matches for the changed files in the PR'
type: choice
options:
- "[]"
- '[llvm, clang, sycl, llvm_spirv, xptifw, libclc, libdevice]'
build_cache_suffix:
type: choice
options:
- "default"
artifact_archive_name:
type: choice
options:
- 'llvm_sycl.tar.gz'
default:
retention-days:
type: choice
options:
- 3
permissions: read-all
jobs:
build:
name: Build + LIT
runs-on: [Windows, build]
environment: WindowsCILock
# TODO use cached checkout
outputs:
build_conclusion: ${{ steps.build.conclusion }}
steps:
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
with:
arch: amd64
- 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 "SCCACHE_DIR=D:\github\_work\cache\${{ inputs.build_cache_suffix }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- uses: actions/checkout@v4
with:
path: src
ref: ${{ inputs.build_ref || github.sha }}
fetch-depth: 1
- name: Register cleanup after job is finished
uses: ./src/devops/actions/cleanup
- name: Configure
shell: cmd
# 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 ^
--cmake-opt="-DCMAKE_C_COMPILER=cl" ^
--cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^
--cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^
--cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" ^
--cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" ^
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
- name: Build
id: build
shell: bash
run: |
cmake --build build --target sycl-toolchain
- name: check-llvm
if: always() && !cancelled() && contains(inputs.changes, 'llvm')
run: |
cmake --build build --target check-llvm
- name: check-clang
if: always() && !cancelled() && contains(inputs.changes, 'clang')
run: |
cmake --build build --target check-clang
- name: check-sycl
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
run: |
cmake --build build --target check-sycl
- name: check-sycl-unittests
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
run: |
cmake --build build --target check-sycl-unittests
- name: check-llvm-spirv
if: always() && !cancelled() && contains(inputs.changes, 'llvm_spirv')
run: |
cmake --build build --target check-llvm-spirv
- name: check-xptifw
if: always() && !cancelled() && contains(inputs.changes, 'xptifw')
run: |
cmake --build build --target check-xptifw
- name: check-libdevice
if: always() && !cancelled() && contains(inputs.changes, 'libdevice')
run: |
cmake --build build --target check-libdevice
- name: Install
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
shell: bash
# TODO replace utility installation with a single CMake target
run: |
cmake --build build --target deploy-sycl-toolchain
cmake --build build --target utils/FileCheck/install
cmake --build build --target utils/count/install
cmake --build build --target utils/not/install
cmake --build build --target utils/lit/install
cmake --build build --target utils/llvm-lit/install
cmake --build build --target install-llvm-size
cmake --build build --target install-llvm-cov
cmake --build build --target install-llvm-profdata
cmake --build build --target install-compiler-rt
- name: Pack toolchain
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
shell: bash
run: |
tar -czf ${{ inputs.artifact_archive_name }} -C install .
- name: Upload toolchain
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
uses: actions/upload-artifact@v4
with:
name: sycl_windows_default
path: ${{ inputs.artifact_archive_name }}
retention-days: ${{ inputs.retention-days }}