-
Notifications
You must be signed in to change notification settings - Fork 853
241 lines (233 loc) · 10.1 KB
/
continuous_deployment.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
# 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
# NOTE: The following documentation may be useful to maintainers of this workflow.
# Github actions: https://docs.github.com/en/actions
# Github github-script action: https://github.com/actions/github-script
# GitHub REST API: https://docs.github.com/en/rest
# Octokit front-end to the GitHub REST API: https://octokit.github.io/rest.js/v18
# Octokit endpoint methods: https://github.com/octokit/plugin-rest-endpoint-methods.js/tree/master/docs/repos
# TODO: Use actions/upload-artifact and actions/download-artifact to simplify deployment.
# TODO: Use composite actions to refactor redundant code.
name: Continuous Deployment
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'README-spirv-remap.txt'
- 'LICENSE.txt'
- 'CODE_OF_CONDUCT.md'
- 'BUILD.*'
- 'WORKSPACE'
- 'kokoro/*'
- 'make-revision'
- 'Android.mk'
- '_config.yml'
permissions: read-all
jobs:
linux:
runs-on: ${{matrix.os.genus}}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
os: [{genus: ubuntu-20.04, family: linux}]
compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
cmake_build_type: [Debug, Release]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: '3.7'
- name: Install Ubuntu Package Dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y clang-6.0
- run: ./update_glslang_sources.py
- name: Build
env:
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install ..
make -j4 install
- name: Test
run: |
cd build
ctest --output-on-failure &&
cd ../Test && ./runtests
- name: Zip
if: ${{ matrix.compiler.cc == 'clang' }}
env:
ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
run: |
cd build/install
zip ${ARCHIVE} \
bin/glslang \
bin/glslangValidator \
include/glslang/* \
include/glslang/**/* \
lib/libGenericCodeGen.a \
lib/libglslang.a \
lib/libglslang-default-resource-limits.a \
lib/libHLSL.a \
lib/libMachineIndependent.a \
lib/libOGLCompiler.a \
lib/libOSDependent.a \
lib/libSPIRV.a \
lib/libSPVRemapper.a \
lib/libSPIRV-Tools.a \
lib/libSPIRV-Tools-opt.a
- name: Deploy
if: ${{ matrix.compiler.cc == 'clang' }}
env:
ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const script = require('.github/workflows/deploy.js')
await script({github, context, core})
macos:
runs-on: ${{matrix.os.genus}}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
os: [{genus: macos-11, family: osx}]
compiler: [{cc: clang, cxx: clang++}]
cmake_build_type: [Debug, Release]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: '3.7'
- run: ./update_glslang_sources.py
- name: Build
env:
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install ..
make -j4 install
- name: Test
run: |
cd build
ctest --output-on-failure &&
cd ../Test && ./runtests
- name: Zip
env:
ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
run: |
cd build/install
zip ${ARCHIVE} \
bin/glslang \
bin/glslangValidator \
include/glslang/* \
include/glslang/**/* \
lib/libGenericCodeGen.a \
lib/libglslang.a \
lib/libglslang-default-resource-limits.a \
lib/libHLSL.a \
lib/libMachineIndependent.a \
lib/libOGLCompiler.a \
lib/libOSDependent.a \
lib/libSPIRV.a \
lib/libSPVRemapper.a \
lib/libSPIRV-Tools.a \
lib/libSPIRV-Tools-opt.a
- name: Deploy
env:
ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const script = require('.github/workflows/deploy.js')
await script({github, context, core})
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: '3.7'
- 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
- name: Zip
if: ${{ matrix.cmake_build_type == 'Debug' }}
env:
ARCHIVE: glslang-master-${{matrix.os.family}}-Debug.zip
run: |
cd build/install
7z a ${{env.ARCHIVE}} `
bin/glslang.exe `
bin/glslangValidator.exe `
bin/spirv-remap.exe `
include/glslang/* `
lib/GenericCodeGend.lib `
lib/glslangd.lib `
lib/glslang-default-resource-limitsd.lib `
lib/HLSLd.lib `
lib/MachineIndependentd.lib `
lib/OGLCompilerd.lib `
lib/OSDependentd.lib `
lib/SPIRVd.lib `
lib/SPVRemapperd.lib `
lib/SPIRV-Toolsd.lib `
lib/SPIRV-Tools-optd.lib
- name: Zip
if: ${{ matrix.cmake_build_type == 'Release' }}
env:
ARCHIVE: glslang-master-${{matrix.os.family}}-Release.zip
run: |
cd build/install
7z a ${{env.ARCHIVE}} `
bin/glslang.exe `
bin/glslangValidator.exe `
bin/spirv-remap.exe `
include/glslang/* `
lib/GenericCodeGen.lib `
lib/glslang.lib `
lib/glslang-default-resource-limits.lib `
lib/HLSL.lib `
lib/MachineIndependent.lib `
lib/OGLCompiler.lib `
lib/OSDependent.lib `
lib/SPIRV.lib `
lib/SPVRemapper.lib `
lib/SPIRV-Tools.lib `
lib/SPIRV-Tools-opt.lib
- name: Deploy
env:
ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const script = require('.github/workflows/deploy.js')
await script({github, context, core})