-
Notifications
You must be signed in to change notification settings - Fork 0
322 lines (283 loc) · 15.3 KB
/
quality-gate.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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
name: CI Quality Gate
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
build-and-test:
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- os: "linux"
name: "amd64-avx2"
runs-on: "ubuntu-20-04"
cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
run-e2e: true
vulkan: false
sccache: true
sccache-conf-path: "/tmp/sccache.conf"
# - os: "linux"
# name: "amd64-noavx"
# runs-on: "ubuntu-20-04"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: "/tmp/sccache.conf"
# - os: "linux"
# name: "amd64-avx"
# runs-on: "ubuntu-20-04"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_AVX2=OFF -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: "/tmp/sccache.conf"
# - os: "linux"
# name: "amd64-avx512"
# runs-on: "ubuntu-20-04"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_AVX512=ON -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: "/tmp/sccache.conf"
# - os: "linux"
# name: "amd64-vulkan"
# runs-on: "ubuntu-20-04-cuda-11-7"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_VULKAN=ON -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
# run-e2e: false
# vulkan: true
# sccache: true
# sccache-conf-path: "/tmp/sccache.conf"
# - os: "linux"
# name: "amd64-avx2-cuda-11-7"
# runs-on: "ubuntu-20-04-cuda-11-7"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: "/tmp/sccache.conf"
# - os: "linux"
# name: "amd64-avx-cuda-11-7"
# runs-on: "ubuntu-20-04-cuda-11-7"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_AVX2=OFF -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: "/tmp/sccache.conf"
# - os: "linux"
# name: "amd64-avx512-cuda-11-7"
# runs-on: "ubuntu-20-04-cuda-11-7"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_AVX512=ON -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: "/tmp/sccache.conf"
# - os: "linux"
# name: "amd64-avx2-cuda-12-0"
# runs-on: "ubuntu-20-04-cuda-12-0"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: "/tmp/sccache.conf"
# - os: "linux"
# name: "amd64-avx-cuda-12-0"
# runs-on: "ubuntu-20-04-cuda-12-0"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_AVX2=OFF -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: "/tmp/sccache.conf"
# - os: "linux"
# name: "amd64-avx512-cuda-12-0"
# runs-on: "ubuntu-20-04-cuda-12-0"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_AVX512=ON -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE='Release' -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: "/tmp/sccache.conf"
- os: "mac"
name: "amd64"
runs-on: "macos-13"
cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DBUILD_SHARED_LIBS=OFF -DGGML_METAL=OFF"
run-e2e: true
vulkan: false
sccache: false
sccache-conf-path: ""
- os: "mac"
name: "arm64"
runs-on: "macos-silicon"
cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DBUILD_SHARED_LIBS=OFF -DGGML_METAL_EMBED_LIBRARY=ON"
run-e2e: true
vulkan: false
sccache: false
sccache-conf-path: ""
- os: "windows"
name: "amd64-avx2"
runs-on: "windows-2019"
cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_NATIVE=OFF -DWHISPER_SDL2=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -GNinja"
run-e2e: false
vulkan: false
sccache: false
sccache-conf-path: ""
- os: "windows"
name: "amd64-avx"
runs-on: "windows-2019"
cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_NATIVE=OFF -DGGML_AVX2=OFF -DWHISPER_SDL2=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -GNinja"
run-e2e: false
vulkan: false
sccache: false
sccache-conf-path: ""
- os: "windows"
name: "amd64-avx512"
runs-on: "windows-2019"
cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_NATIVE=OFF -DGGML_AVX512=ON -DWHISPER_SDL2=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -GNinja"
run-e2e: false
vulkan: false
sccache: false
sccache-conf-path: ""
- os: "windows"
name: "amd64-vulkan"
runs-on: "windows-2019"
cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_NATIVE=OFF -DGGML_VULKAN=ON -DWHISPER_SDL2=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -GNinja"
run-e2e: false
vulkan: true
sccache: false
sccache-conf-path: ""
- os: "windows"
name: "amd64-avx2-cuda-12-0"
runs-on: "windows-cuda-12-0"
cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DWHISPER_SDL2=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CUDA_COMPILER_LAUNCHER=sccache -GNinja"
run-e2e: false
vulkan: false
sccache: true
sccache-conf-path: 'C:\sccache.conf'
# - os: "windows"
# name: "amd64-avx-cuda-12-0"
# runs-on: "windows-cuda-12-0"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_AVX2=OFF -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CUDA_COMPILER_LAUNCHER=sccache -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: 'C:\sccache.conf'
# - os: "windows"
# name: "amd64-avx512-cuda-12-0"
# runs-on: "windows-cuda-12-0"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_AVX512=ON -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CUDA_COMPILER_LAUNCHER=sccache -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: 'C:\sccache.conf'
# - os: "windows"
# name: "amd64-avx2-cuda-11-7"
# runs-on: "windows-cuda-11-7"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CUDA_COMPILER_LAUNCHER=sccache -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: 'C:\sccache.conf'
# - os: "windows"
# name: "amd64-avx-cuda-11-7"
# runs-on: "windows-cuda-11-7"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_AVX2=OFF -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CUDA_COMPILER_LAUNCHER=sccache -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: 'C:\sccache.conf'
# - os: "windows"
# name: "amd64-avx512-cuda-11-7"
# runs-on: "windows-cuda-11-7"
# cmake-flags: "-DCORTEXAUDIO_VERSION=${{github.event.pull_request.head.sha}} -DGGML_AVX512=ON -DGGML_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DGGML_CUDA=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE='Release' -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CUDA_COMPILER_LAUNCHER=sccache -GNinja"
# run-e2e: false
# vulkan: false
# sccache: true
# sccache-conf-path: 'C:\sccache.conf'
steps:
- name: Clone
id: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare Vulkan SDK
if: ${{ matrix.vulkan }}
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.3.275.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: create sccache.conf
if: ${{ matrix.sccache }}
run: |
echo "[cache.s3]" > ${{ matrix.sccache-conf-path }}
echo 'bucket = "${{ secrets.MINIO_BUCKET_NAME }}"' >> ${{ matrix.sccache-conf-path }}
echo 'endpoint = "${{ secrets.MINIO_ENDPOINT }}"' >> ${{ matrix.sccache-conf-path }}
echo 'key_prefix = "${{ matrix.os }}-${{ matrix.name }}"' >> ${{ matrix.sccache-conf-path }}
echo 'use_ssl = false' >> ${{ matrix.sccache-conf-path }}
echo 'server_side_encryption = false' >> ${{ matrix.sccache-conf-path }}
echo 'no_credentials = false' >> ${{ matrix.sccache-conf-path }}
- name: Fetch SDL2 on Windows
if: runner.os == 'Windows'
run: |
C:/msys64/usr/bin/wget.exe -qO sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-devel-2.28.5-VC.zip
7z x sdl2.zip -aoa
echo "SDL2_DIR=$env:GITHUB_WORKSPACE/SDL2-2.28.5/cmake" >> $env:GITHUB_ENV
- name: Install SDL2 on MacOS
if: runner.os == 'macOS'
continue-on-error: true
run: |
brew update
brew install sdl2
- name: Install choco on Windows
if: runner.os == 'Windows'
run: |
choco install make sccache ninja -y
- name: Install ninja build on Linux
if: runner.os == 'Linux'
run: |
sudo apt install ninja-build -y
- name: Add msbuild to PATH
if: runner.os == 'Windows'
uses: ilammy/[email protected]
- name: start scache server
if: ${{ matrix.sccache }}
run: |
sccache --start-server
env:
SCCACHE_BUCKET: "${{ secrets.MINIO_BUCKET_NAME }}"
SCCACHE_REGION: "${{ secrets.MINIO_REGION }}"
SCCACHE_ENDPOINT: "${{ secrets.MINIO_ENDPOINT }}"
SCCACHE_S3_USE_SSL: "false"
SCCACHE_S3_SERVER_SIDE_ENCRYPTION: "false"
SCCACHE_S3_KEY_PREFIX: "${{ matrix.os }}-${{ matrix.name }}"
SCCACHE_LOG: "debug"
SCCACHE_CONF: '${{ matrix.sccache-conf-path }}'
AWS_ACCESS_KEY_ID: "${{ secrets.MINIO_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.MINIO_SECRET_ACCESS_KEY }}"
SCCACHE_IDLE_TIMEOUT: "0"
- name: Build
run: |
make build-example-server CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}"
- name: Pre Package
run: |
make pre-package
- name: Package
run: |
make package
- name: Run e2e testing
if: ${{ matrix.run-e2e }}
run: |
make run-e2e-test LLM_MODEL_URL=${{ env.LLM_MODEL_URL }} EMBEDDING_MODEL_URL=${{ env.EMBEDDING_MODEL_URL }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: cortex.audio-${{ matrix.os }}-${{ matrix.name }}
path: ./cortex.audio
- name: Clean
if: always()
continue-on-error: true
run: |
sccache --stop-server
rm ${{ matrix.sccache-conf-path }}