-
Notifications
You must be signed in to change notification settings - Fork 854
307 lines (298 loc) · 13.5 KB
/
continuous_integration.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
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# NOTE: This workflow was ported from Travis.
# Travis was using Ubuntu 14.04. Ubuntu 14.04 is not supportted by GitHub workflows. Ubuntu 20.04 is recommended.
# Travis was using Clang 3.6. The earliest version support by Ubuntu 20.04 is Clang 6.0.
# Travis was caching the clang package. APT package caching is not natively supported by GitHub actions/cache.
# Travis was using Mac OS X 10.13.6 / Xcode 9.4.1 / LLVM 9.1.0
#
name: Continuous Integration
on:
workflow_dispatch:
pull_request:
branches:
- main
permissions: read-all
jobs:
linux:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
cmake_build_type: [Debug, Release]
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: lukka/get-cmake@4dcd3eb73017c61159eb130746fbca35d78a3d5f # v3.27.4
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}
- name: Install GoogleTest
run: |
# check out pre-breakage version of googletest; can be deleted when
# issue 3128 is fixed
# git clone --depth=1 https://github.com/google/googletest.git External/googletest
mkdir -p External/googletest
cd External/googletest
git init
git remote add origin https://github.com/google/googletest.git
git fetch --depth 1 origin 0c400f67fcf305869c5fb113dd296eca266c9725
git reset --hard FETCH_HEAD
cd ../..
- name: Update Glslang Sources
run: ./update_glslang_sources.py
- name: Configure
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
env:
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
CMAKE_GENERATOR: Ninja
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
- name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix build/install
- name: Test
run: |
cd build
ctest --output-on-failure &&
cd ../Test && ./runtests
linux-asan:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [{cc: gcc, cxx: g++}]
cmake_build_type: [Debug]
flags: ['-fsanitize=address', '-fsanitize=thread']
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: lukka/get-cmake@4dcd3eb73017c61159eb130746fbca35d78a3d5f # v3.27.4
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}-${{matrix.flags}}
- name: Install GoogleTest
run: |
# check out pre-breakage version of googletest; can be deleted when
# issue 3128 is fixed
# git clone --depth=1 https://github.com/google/googletest.git External/googletest
mkdir -p External/googletest
cd External/googletest
git init
git remote add origin https://github.com/google/googletest.git
git fetch --depth 1 origin 0c400f67fcf305869c5fb113dd296eca266c9725
git reset --hard FETCH_HEAD
cd ../..
- name: Update Glslang Sources
run: ./update_glslang_sources.py
- name: Configure
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
env:
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
CMAKE_GENERATOR: Ninja
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CFLAGS: ${{matrix.flags}}
CXXFLAGS: ${{matrix.flags}}
LDFLAGS: ${{matrix.flags}}
- name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix build/install
- name: Test
run: |
cd build
ctest --output-on-failure &&
cd ../Test && ./runtests
# Ensure we can compile/run on an older distro
linux_min:
name: Linux Backcompat
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- uses: lukka/get-cmake@4dcd3eb73017c61159eb130746fbca35d78a3d5f # v3.27.4
with:
cmakeVersion: 3.17.2
- name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: linux_backcompat
- name: Install GoogleTest
run: |
# check out pre-breakage version of googletest; can be deleted when
# issue 3128 is fixed
# git clone --depth=1 https://github.com/google/googletest.git External/googletest
mkdir -p External/googletest
cd External/googletest
git init
git remote add origin https://github.com/google/googletest.git
git fetch --depth 1 origin 0c400f67fcf305869c5fb113dd296eca266c9725
git reset --hard FETCH_HEAD
cd ../..
- name: Update Glslang Sources
run: ./update_glslang_sources.py
- name: Configure
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Release
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
- name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix build/install
- name: Test
run: |
cd build
ctest --output-on-failure &&
cd ../Test && ./runtests
macos:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [macos-11, macos-12]
compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
cmake_build_type: [Debug, Release]
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- uses: lukka/get-cmake@4dcd3eb73017c61159eb130746fbca35d78a3d5f # v3.27.4
- name: Install GoogleTest
run: |
# check out pre-breakage version of googletest; can be deleted when
# issue 3128 is fixed
# git clone --depth=1 https://github.com/google/googletest.git External/googletest
mkdir -p External/googletest
cd External/googletest
git init
git remote add origin https://github.com/google/googletest.git
git fetch --depth 1 origin 0c400f67fcf305869c5fb113dd296eca266c9725
git reset --hard FETCH_HEAD
cd ../..
- name: Update Glslang Sources
run: ./update_glslang_sources.py
- name: Configure
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -G "Ninja"
env:
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
- name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix build/install
- name: Test
run: |
cd build
ctest --output-on-failure &&
cd ../Test && ./runtests
windows:
runs-on: ${{matrix.os.genus}}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
os: [{genus: windows-2019, family: windows}]
cmake_build_type: [Debug, Release]
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: lukka/get-cmake@4dcd3eb73017c61159eb130746fbca35d78a3d5f # v3.27.4
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- name: Install GoogleTest
run: |
# check out pre-breakage version of googletest; can be deleted when
# issue 3128 is fixed
# git clone --depth=1 https://github.com/google/googletest.git External/googletest
mkdir -p External/googletest
cd External/googletest
git init
git remote add origin https://github.com/google/googletest.git
git fetch --depth 1 origin 0c400f67fcf305869c5fb113dd296eca266c9725
git reset --hard FETCH_HEAD
cd ../..
- name: Update Glslang Sources
run: |
python update_glslang_sources.py
- name: Build
run: |
cmake -S. -Bbuild -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install"
cmake --build build --config ${{matrix.cmake_build_type}} --target install
- name: Test
run: |
cd build
ctest -C ${{matrix.cmake_build_type}} --output-on-failure
cd ../Test && bash runtests
android:
runs-on: ubuntu-22.04
strategy:
matrix:
# Android NDK currently offers 2 different toolchains.
# Test both to ensure we are compatible with either approach.
LEGACY: [ON, OFF]
# Oldest/newest NDK currently provided by GitHub runners
# https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#android
NDK: [23.2.8568313, 25.2.9519653]
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- uses: lukka/get-cmake@4dcd3eb73017c61159eb130746fbca35d78a3d5f # v3.27.4
- name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: android-${{ matrix.LEGACY }}-${{ matrix.NDK }}
- name: Update Glslang Sources
run: ./update_glslang_sources.py
- name: Configure
run: |
cmake -S . -B build/ \
--toolchain $ANDROID_HOME/ndk/${{ matrix.NDK }}/build/cmake/android.toolchain.cmake \
-D CMAKE_BUILD_TYPE=Release \
-D ANDROID_ABI=armeabi-v7a \
-D ANDROID_USE_LEGACY_TOOLCHAIN_FILE=${{ matrix.LEGACY }} \
-D BUILD_TESTING=OFF
env:
CMAKE_GENERATOR: Ninja
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
- name: Build
run: cmake --build build/
emscripten:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- uses: lukka/get-cmake@4dcd3eb73017c61159eb130746fbca35d78a3d5f # v3.27.4
- name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: ubuntu-emscripten
- uses: mymindstorm/setup-emsdk@ab889da2abbcbb280f91ec4c215d3bb4f3a8f775 # v12
- name: Update Glslang Sources
run: ./update_glslang_sources.py
- name: Configure
run: emcmake cmake -GNinja -Bbuild/web -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_JS=ON -DBUILD_TESTING=OFF -DENABLE_OPT=OFF
env:
CMAKE_GENERATOR: Ninja
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
- name: Build
run: cmake --build build/web