Repository navigation
347 lines (324 loc) · 10.1 KB
/
Copy pathbuild-test-deploy.yml
File metadata and controls
347 lines (324 loc) · 10.1 KB
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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
name: Build, test, and deploy
on:
# Run this workflow every day at 3:00 UTC to update caches.
schedule: [cron: "0 3 * * *"]
# Allow manual trigger.
workflow_dispatch:
pull_request:
branches: ["master"]
push:
branches: ["master"]
tags: ["v*"]
# Cancel old builds when pushing new commits.
concurrency:
group: build-test-deploy-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
###########################################################################
# Preparation jobs
###########################################################################
prepare:
name: Prepare
uses: TokTok/ci-tools/.github/workflows/deploy-prepare.yml@master
###########################################################################
# Static analysis and other checks
###########################################################################
translation-check:
name: Check for translatable strings
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Checkout ci-tools
uses: actions/checkout@v6
with:
repository: TokTok/ci-tools
path: third_party/ci-tools
submodules: true
- name: Install deps
run: sudo apt-get update && sudo apt-get install qt6-l10n-tools
- name: Test for modified translatable strings
run: |
export PATH="/usr/lib/qt6/bin:$PATH"
tools/update-translation-files.sh ALL
third_party/ci-tools/tools/translate.py
git diff --exit-code
clang-tidy:
name: Clang-Tidy
needs: [prepare]
if: github.event_name != 'push'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Cache compiler output
uses: actions/cache@v5
with:
path: |
.cache/ccache
.cache/clangd
.lsp_tidy_cache
key: ${{ github.job }}-ccache
- name: Run build
run: docker compose run
--rm
fedora
.ci-scripts/build-qtox-linux.sh
--build-type Debug
--full
--tidy || (git diff --exit-code && false)
###########################################################################
# Build and test jobs (PR)
###########################################################################
build-alpine:
name: Alpine
needs: [prepare]
if: github.event_name != 'push'
runs-on: ubuntu-24.04
strategy:
matrix:
features: [full]
build_type: [Debug]
steps:
- uses: actions/checkout@v6
- name: Cache compiler output
uses: actions/cache@v5
with:
path: ".cache/ccache"
key: ${{ github.job }}-ccache
- name: Run build
run: docker compose run
--rm alpine
.ci-scripts/build-qtox-linux.sh
--build-type ${{ matrix.build_type }}
--${{ matrix.features }}
build-alpine-static:
name: Alpine (static)
needs: [prepare]
if: github.event_name != 'push'
runs-on: ubuntu-24.04
strategy:
matrix:
build_type: [Release]
steps:
- uses: actions/checkout@v6
- name: Cache compiler output
uses: actions/cache@v5
with:
path: ".cache/ccache"
key: ${{ github.job }}-ccache
- name: Run build
run: docker compose run
--rm alpine-static
.ci-scripts/build-qtox-linux-static.sh
--build-type ${{ matrix.build_type }}
build-debian:
name: Debian
needs: [prepare]
if: github.event_name != 'push'
runs-on: ubuntu-24.04
strategy:
matrix:
features: [minimal]
build_type: [Debug]
steps:
- uses: actions/checkout@v6
- name: Cache compiler output
uses: actions/cache@v5
with:
path: ".cache/ccache"
key: ${{ github.job }}-ccache
- name: Run build
run: docker compose run
--rm
debian
.ci-scripts/build-qtox-linux.sh
--build-type ${{ matrix.build_type }}
--${{ matrix.features }}
--sanitize
build-fedora:
name: Fedora with ASAN
needs: [prepare]
if: github.event_name != 'push'
runs-on: ubuntu-24.04
strategy:
matrix:
features: [full]
build_type: [Debug]
steps:
- uses: actions/checkout@v6
- name: Cache compiler output
uses: actions/cache@v5
with:
path: ".cache/ccache"
key: ${{ github.job }}-ccache
- name: Run build
run: docker compose run
--rm
fedora
.ci-scripts/build-qtox-linux.sh
--build-type ${{ matrix.build_type }}
--${{ matrix.features }}
--sanitize
build-macos-user:
name: macOS user
needs: [prepare]
if: github.event_name != 'push'
strategy:
matrix:
arch: [arm64, x86_64]
exclude:
- arch: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') && 'arm64' }}
runs-on: ${{ matrix.arch == 'x86_64' && 'macos-15-intel' || 'macos-14' }}
steps:
- uses: actions/checkout@v6
- name: Checkout ci-tools
uses: actions/checkout@v6
with:
repository: TokTok/ci-tools
path: third_party/ci-tools
submodules: true
- name: Checkout dockerfiles
uses: actions/checkout@v6
with:
repository: TokTok/dockerfiles
path: third_party/dockerfiles
submodules: true
- name: Cache compiler output
uses: actions/cache@v5
with:
path: ".cache/ccache"
key: ${{ github.job }}-${{ matrix.arch }}-ccache
- name: Homebrew
run: |
brew bundle --file platform/macos/Brewfile
sed -i '' -e 's/MAXIMUM_UNMOUNTING_ATTEMPTS=3/MAXIMUM_UNMOUNTING_ATTEMPTS=15/' "$(realpath "$(which create-dmg)")"
- name: Set up ccache
run: ccache --set-config=max_size=200M --set-config=cache_dir="$PWD/.cache/ccache" && ccache --show-config
- name: Install toxcore
run: third_party/dockerfiles/qtox/build_toxcore_system.sh sudo
- name: Build qTox
run: third_party/ci-tools/platform/macos/build.sh
--project-name qTox
--build-type user
--arch ${{ matrix.arch }}
--macos-version 12.0
build-ubuntu:
name: Ubuntu LTS
needs: [prepare]
if: github.event_name != 'push'
runs-on: ubuntu-24.04
strategy:
matrix:
features: [full]
build_type: [Release]
steps:
- uses: actions/checkout@v6
- name: Cache compiler output
uses: actions/cache@v5
with:
path: ".cache/ccache"
key: ${{ github.job }}-ccache
- name: Run build
run: docker compose run
--rm
ubuntu_lts
.ci-scripts/build-qtox-linux.sh
--build-type ${{ matrix.build_type }}
--${{ matrix.features }}
- name: Code coverage
run: |
# https://github.com/actions/runner/issues/491
if [ "${{ matrix.build_type }}" == "Release" ] && [ "${{ matrix.features }}" == "full" ]; then
docker compose run --rm ubuntu_lts .ci-scripts/lcov.sh
# Upload report to codecov.io
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
fi
build-wasm:
name: WebAssembly
needs: [prepare]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Cache compiler output
uses: actions/cache@v5
with:
path: ".cache/ccache"
key: ${{ github.job }}-ccache
- name: Run build
run: docker compose run --rm wasm_builder platform/wasm/build.sh
- name: Upload zip
uses: actions/upload-artifact@v6
with:
name: qtox-wasm
path: _site
###########################################################################
# Deploy jobs (release artifacts)
###########################################################################
android:
name: Android
uses: TokTok/ci-tools/.github/workflows/deploy-android.yml@master
needs: [prepare]
with:
cmake-args: -D STRICT_OPTIONS=ON
appimage:
name: AppImage
uses: TokTok/ci-tools/.github/workflows/deploy-appimage.yml@master
needs: [prepare]
with:
cmake-args: -D STRICT_OPTIONS=ON
screenshot: true
smoke-test: .ci-scripts/smoke-test.sh
test-files: |
.ci-scripts/smoke-test.sh
test/resources/profile
flatpak:
name: Flatpak
uses: TokTok/ci-tools/.github/workflows/deploy-flatpak.yml@master
needs: [prepare]
with:
org-name: io.github.qtox
smoke-test: .ci-scripts/smoke-test.sh
test-files: |
.ci-scripts/smoke-test.sh
test/resources/profile
macos:
name: macOS
uses: TokTok/ci-tools/.github/workflows/deploy-macos.yml@master
needs: [prepare]
with:
cmake-args: -D STRICT_OPTIONS=ON
screenshot: true
smoke-test: .ci-scripts/smoke-test.sh
test-files: |
.ci-scripts/smoke-test.sh
test/resources/profile
windows:
name: Windows
uses: TokTok/ci-tools/.github/workflows/deploy-windows.yml@master
needs: [prepare]
with:
cmake-args: -D STRICT_OPTIONS=ON
smoke-test: .ci-scripts/smoke-test.sh
test-files: .ci-scripts/smoke-test.sh
###########################################################################
# Documentation/website jobs
###########################################################################
build-docs:
name: Docs
needs: [prepare]
runs-on: ubuntu-24.04
env:
DOXYGEN_CONFIG_FILE: doxygen.conf
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Run
run: .ci-scripts/build-docs.sh
- name: Deploy
if: github.ref == 'refs/heads/master' && github.repository_owner == 'qTox'
env:
access_key: ${{ secrets.DOXYGEN_DEPLOY_KEY }}
run: .ci-scripts/deploy-docs.sh