forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 0
208 lines (203 loc) · 7.71 KB
/
check-in-tree-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
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
# This workflow is intended to check that in-tree build of the translator is
# healthy and all tests pass. It is used in pre-commits and nightly builds.
#
# Documentation for GitHub Actions:
# [workflow-syntax]: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
# [context-and-expression-syntax]: https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions
name: In-tree build & tests
on:
push:
branches:
- main
- llvm_release_*
paths-ignore: # no need to check build for:
- 'docs/**' # documentation
- '**.md' # README
- '**/check-code-style.yml' # check-code-style workflow
- '**/check-out-of-tree-build.yml' # check-out-of-tree-build workflow
pull_request:
branches:
- main
- llvm_release_*
paths-ignore: # no need to check build for:
- 'docs/**' # documentation
- '**.md' # README
- '**/check-code-style.yml' # check-code-style workflow
- '**/check-out-of-tree-build.yml' # check-out-of-tree-build workflow
schedule:
# Ideally, we might want to simplify our regular nightly build as we
# probably don't need every configuration to be built every day: most of
# them are only necessary in pre-commits to avoid breakages
- cron: 0 0 * * *
env:
LLVM_VERSION: 15
jobs:
build_and_test_linux:
name: Linux
strategy:
matrix:
build_type: [Release, Debug]
shared_libs: [NoSharedLibs]
include:
- build_type: Release
shared_libs: EnableSharedLibs
fail-fast: false
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: |
curl -L "https://apt.llvm.org/llvm-snapshot.gpg.key" | sudo apt-key add -
curl -L "https://packages.lunarg.com/lunarg-signing-key-pub.asc" | sudo apt-key add -
echo "deb https://apt.llvm.org/focal/ llvm-toolchain-focal-15 main" | sudo tee -a /etc/apt/sources.list
echo "deb https://packages.lunarg.com/vulkan focal main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install \
clang-${{ env.LLVM_VERSION }} \
spirv-tools
# Linux systems in GitHub Actions already have older versions of clang
# pre-installed. Make sure to override these with the relevant version.
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{ env.LLVM_VERSION }} 1000
- name: Checkout LLVM sources
uses: actions/checkout@v2
with:
repository: llvm/llvm-project
ref: release/15.x
path: llvm-project
- name: Checkout the translator sources
uses: actions/checkout@v2
with:
path: llvm-project/llvm/projects/SPIRV-LLVM-Translator
- name: Get tag for SPIR-V Headers
id: spirv-headers-tag
run: |
echo "spirv_headers_tag=$(cat llvm-project/llvm/projects/SPIRV-LLVM-Translator/spirv-headers-tag.conf)" >> $GITHUB_ENV
- name: Checkout SPIR-V Headers
uses: actions/checkout@v2
with:
repository: KhronosGroup/SPIRV-Headers
ref: ${{ env.spirv_headers_tag }}
path: llvm-project/llvm/projects/SPIRV-Headers
- name: Configure
run: |
mkdir build && cd build
# ON/OFF specifically weren't used as a values for shared_libs matrix
# field to improve usability of PR page: instead of (Release, ON) a
# job will be displayed as (Release, EnableSharedLibs)
SHARED_LIBS=OFF
if [[ "${{ matrix.shared_libs }}" == "EnableSharedLibs" ]]; then
SHARED_LIBS=ON
fi
cmake ${{ github.workspace }}/llvm-project/llvm \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_SHARED_LIBS=${SHARED_LIBS} \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DSPIRV_SKIP_CLANG_BUILD=ON \
-DSPIRV_SKIP_DEBUG_INFO_TESTS=ON \
-DLLVM_LIT_ARGS="-sv --no-progress-bar" \
-G "Unix Makefiles"
- name: Build
run: |
cd build
make llvm-spirv -j2
- name: Build tests & test
run: |
cd build
make check-llvm-spirv -j2
build_windows:
name: Windows
strategy:
matrix:
build_type: [Release]
fail-fast: false
runs-on: windows-latest
steps:
- name: Checkout LLVM sources
uses: actions/checkout@v2
with:
repository: llvm/llvm-project
ref: release/15.x
path: llvm-project
- name: Checkout the translator sources
uses: actions/checkout@v2
with:
path: llvm-project\\llvm\\projects\\SPIRV-LLVM-Translator
- name: Get tag for SPIR-V Headers
id: spirv-headers-tag
run: |
echo "spirv_headers_tag=$(type llvm-project\\llvm\\projects\\SPIRV-LLVM-Translator\\spirv-headers-tag.conf)" >> $GITHUB_ENV
- name: Checkout SPIR-V Headers
uses: actions/checkout@v2
with:
repository: KhronosGroup/SPIRV-Headers
ref: ${{ env.spirv_headers_tag }}
path: llvm-project\\llvm\\projects\\SPIRV-Headers
- name: Configure
shell: bash
run: |
mkdir build && cd build
cmake ..\\llvm-project\\llvm \
-Thost=x64 \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DSPIRV_SKIP_CLANG_BUILD=ON \
-DSPIRV_SKIP_DEBUG_INFO_TESTS=ON \
-DLLVM_LIT_ARGS="-sv --no-progress-bar"
- name: Build
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} --target llvm-spirv -j2
# FIXME: Testing is disabled at the moment as it requires clang to be present
# - name: Build tests & test
# shell: bash
# run: |
# cd build
# cmake --build . --config Release --target check-llvm-spirv -j2
build_and_test_macosx:
name: macOS
strategy:
matrix:
build_type: [Release]
fail-fast: false
runs-on: macos-latest
continue-on-error: true
steps:
- name: Checkout LLVM sources
uses: actions/checkout@v2
with:
repository: llvm/llvm-project
ref: release/15.x
path: llvm-project
- name: Checkout the translator sources
uses: actions/checkout@v2
with:
path: llvm-project/llvm/projects/SPIRV-LLVM-Translator
- name: Get tag for SPIR-V Headers
id: spirv-headers-tag
run: |
echo "spirv_headers_tag=$(cat llvm-project/llvm/projects/SPIRV-LLVM-Translator/spirv-headers-tag.conf)" >> $GITHUB_ENV
- name: Checkout SPIR-V Headers
uses: actions/checkout@v2
with:
repository: KhronosGroup/SPIRV-Headers
ref: ${{ env.spirv_headers_tag }}
path: llvm-project/llvm/projects/SPIRV-Headers
- name: Configure
run: |
mkdir build && cd build
cmake ${{ github.workspace }}/llvm-project/llvm \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DSPIRV_SKIP_CLANG_BUILD=ON \
-DSPIRV_SKIP_DEBUG_INFO_TESTS=ON \
-DLLVM_LIT_ARGS="-sv --no-progress-bar" \
-G "Unix Makefiles"
- name: Build
run: |
cd build
make llvm-spirv -j2
# FIXME: Testing is disabled at the moment as it requires clang to be present
# - name: Build tests & test
# run: |
# cd build
# make check-llvm-spirv -j2