-
Notifications
You must be signed in to change notification settings - Fork 4
430 lines (399 loc) · 13 KB
/
ci.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
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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
name: CI
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
FORCE_COLOR: "1"
jobs:
pre-commit:
name: Pre-commit Checks
uses: ./.github/workflows/pre-commit-run.yml
with:
pre-commit-source: pre-commit
test-docs-build-verify:
name: Verify Docs Build
needs: pre-commit
# inherited secrets are not exposed to forked repos
if: ${{ github.event.pull_request.head.repo.owner.login == 'beeware' }}
uses: ./.github/workflows/docs-build-verify.yml
secrets: inherit
with:
project-name: ${{ matrix.name }}
project-version: ${{ matrix.version }}
strategy:
matrix:
name: [ briefcase, toga ]
include:
- name: briefcase
version: v0.3.13
- name: toga
version: v0.3.1
test-install-briefcase:
name: Install Briefcase
needs: pre-commit
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
test-case:
- "main"
- "PR Repo & Ref"
- "PR Repo & Ref (irregular)"
- "PR Ref"
- "refs/tags/v0.3.17"
- "refs/tags/v40.0.5"
- "refs/heads/v0.3.17"
- "refs/heads/v40.0.5"
- "refs/pull/v0.3.17"
- "refs/pull/v40.0.5"
include:
# Test override logic
- test-case: "main"
version: "main"
expected: "main"
# Test PR body override
- test-case: "PR Repo & Ref"
testing-pr-body: "sadf asdf BRIEFCASE_REPO: https://github.com/freakboy3742/briefcase.git xcvbwer BRIEFCASE_REF: 19215d9 xczvb https://example.com/asdf?q=repo%3Aindygreg%2"
expected: "19215d9"
- test-case: "PR Repo & Ref (irregular)"
testing-pr-body: "sadf asdf BrIeFcAsE__REpo: https://github.com/freakboy3742/briefcase.git xcvbwer BRIEFcaseREF:19215d9 xczvb https://example.com/asdf?q=repo%3Aindygreg%2"
expected: "19215d9"
- test-case: "PR Ref"
testing-pr-body: "sadf asdf BRIEFcaseREF: v0.3.17"
expected: "v0.3.17"
# Test version derivation for Releases
- test-case: "refs/tags/v0.3.17"
testing-trigger-ref: "refs/tags/v0.3.17"
testing-ref-name: "v0.3.17"
expected: "v0.3.17"
- test-case: "refs/tags/v40.0.5"
testing-trigger-ref: "refs/tags/v40.0.5"
testing-ref-name: "v40.0.5"
expected: "main"
- test-case: "refs/heads/v0.3.17"
testing-trigger-ref: "refs/heads/v0.3.17"
testing-ref-name: "v0.3.17"
expected: "v0.3.17"
- test-case: "refs/heads/v40.0.5"
testing-trigger-ref: "refs/heads/v40.0.5"
testing-ref-name: "v40.0.5"
expected: "main"
# Test version derivation for PRs
- test-case: "refs/pull/v0.3.17"
testing-trigger-ref: "refs/pull/18/merge"
testing-pr-ref: "refs/heads/v0.3.17"
expected: "v0.3.17"
- test-case: "refs/pull/v40.0.5"
testing-trigger-ref: "refs/pull/25/merge"
testing-pr-ref: "v40.0.5"
expected: "main"
steps:
- name: Checkout beeware/.github
uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.X
cache: pip
cache-dependency-path: |
**/setup.cfg
**/pyproject.toml
.pre-commit-config.yaml
- name: Install Briefcase
id: briefcase
uses: ./.github/actions/install-briefcase
with:
briefcase-override-version: ${{ matrix.version }}
testing-pr-body: ${{ matrix.testing-pr-body }}
testing-trigger-ref: ${{ matrix.testing-trigger-ref }}
testing-pr-ref: ${{ matrix.testing-pr-ref }}
testing-ref-name: ${{ matrix.testing-ref-name }}
- name: Briefcase @ ${{ matrix.test-case }}
run: |
if [[ "${{ matrix.expected }}" != "${{ steps.briefcase.outputs.installed-version }}" ]]; then
echo "installed-version: ${{ steps.briefcase.outputs.installed-version }}"
echo "Found Briefcase version v$(briefcase -V)"
echo "Expected Briefcase version ${{ matrix.expected }}"
exit 1
fi
test-pre-commit-run:
name: Pre-commit
needs: pre-commit
uses: ./.github/workflows/pre-commit-run.yml
with:
repository: beeware/${{ matrix.repo }}
pre-commit-source: ${{ matrix.pre-commit-source }}
strategy:
fail-fast: false
matrix:
repo: [ briefcase, gbulb, Python-support-testbed, rubicon-objc, toga ]
include:
- pre-commit-source: .[dev]
- repo: gbulb
pre-commit-source: pre-commit
- repo: Python-support-testbed
pre-commit-source: pre-commit
- repo: toga
pre-commit-source: ./core[dev]
test-package-python:
name: Create Package
needs: pre-commit
uses: ./.github/workflows/python-package-create.yml
with:
repository: beeware/${{ matrix.repo || matrix.name }}
build-subdirectory: ${{ matrix.build-subdir }}
strategy:
fail-fast: false
matrix:
name:
- briefcase
- briefcase-automation
- gbulb
- rubicon-objc
- toga-core
- toga-android
include:
- name: briefcase-automation
repo: briefcase
build-subdir: automation
- name: toga-core
repo: toga
build-subdir: core
- name: toga-android
repo: toga
build-subdir: android
test-install-requirements:
name: Install Requirements
needs: pre-commit
runs-on: ${{ matrix.runner-os }}
strategy:
fail-fast: false
matrix:
runner-os: [ macos-latest, windows-latest, ubuntu-latest ]
steps:
- name: Checkout beeware/briefcase
uses: actions/[email protected]
with:
repository: beeware/briefcase
- name: Checkout beeware/briefcase to path
uses: actions/[email protected]
with:
repository: beeware/briefcase
path: repos/briefcase
- name: Checkout beeware/.github
uses: actions/[email protected]
with:
repository: beeware/.github
path: repos/.github-beeware
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.x"
- name: Test Install Requirements with Path
uses: ./repos/.github-beeware/.github/actions/install-requirement
with:
requirements: "pre-commit tox"
extra: "dev"
project-root: "repos/briefcase"
- name: Test Install Requirements with Extra
uses: ./repos/.github-beeware/.github/actions/install-requirement
with:
requirements: "coverage"
extra: "dev"
- name: Test Install Requirements
uses: ./repos/.github-beeware/.github/actions/install-requirement
with:
requirements: "cookiecutter"
- name: Verify Requirements Installed
run: |
if ! python -m pip list | grep tox; then
echo '::error::Failed to install tox'
exit 1
fi
if ! python -m pip list | grep pre-commit; then
echo '::error::Failed to install pre-commit'
exit 1
fi
if ! python -m pip list | grep coverage; then
echo '::error::Failed to install coverage'
exit 1
fi
if ! python -m pip list | grep cookiecutter; then
echo '::error::Failed to install cookiecutter'
exit 1
fi
test-verify-projects-briefcase:
name: Verify Project
needs: [ pre-commit, test-package-python ]
uses: ./.github/workflows/app-create-verify.yml
with:
python-version: "3.10" # must match system python for ubuntu version
repository: beeware/briefcase
runner-os: ${{ matrix.runner-os }}
framework: ${{ matrix.framework }}
strategy:
fail-fast: false
matrix:
framework: [ toga, pyside6 ]
runner-os: [ macos-latest, windows-latest, ubuntu-22.04 ]
test-verify-apps-briefcase:
name: Verify Briefcase
needs: [ pre-commit, test-package-python ]
uses: ./.github/workflows/app-build-verify.yml
with:
python-version: "3.10" # must match system python for ubuntu version
repository: beeware/briefcase
runner-os: ${{ matrix.runner-os }}
framework: ${{ matrix.framework }}
strategy:
fail-fast: false
matrix:
framework: [ toga ]
runner-os: [ macos-latest, windows-latest, ubuntu-22.04 ]
test-verify-apps-briefcase-template:
name: Verify Briefcase Template
needs: pre-commit
uses: ./.github/workflows/app-build-verify.yml
with:
python-version: "3.11"
repository: beeware/briefcase-template
runner-os: ${{ matrix.runner-os }}
framework: ${{ matrix.framework }}
strategy:
fail-fast: false
matrix:
framework: [ toga ]
runner-os: [ macos-latest, windows-latest, ubuntu-latest ]
test-verify-apps-android-templates:
name: Verify Android
needs: pre-commit
uses: ./.github/workflows/app-build-verify.yml
with:
python-version: "3.11"
repository: beeware/briefcase-android-gradle-template
runner-os: ${{ matrix.runner-os }}
target-platform: android
target-format: gradle
framework: ${{ matrix.framework }}
strategy:
fail-fast: false
matrix:
framework: [ toga ] # toga only
runner-os: [ macos-latest, windows-latest, ubuntu-latest ]
test-verify-apps-iOS-templates:
name: Verify iOS
needs: pre-commit
uses: ./.github/workflows/app-build-verify.yml
with:
python-version: "3.11"
repository: beeware/briefcase-iOS-xcode-template
runner-os: macos-latest
target-platform: iOS
target-format: xcode
framework: ${{ matrix.framework }}
strategy:
fail-fast: false
matrix:
framework: [ toga ] # toga only
test-verify-apps-linux-system-templates:
name: Verify Linux
needs: pre-commit
uses: ./.github/workflows/app-build-verify.yml
with:
python-version: "3.10" # must match system python for ubuntu version
repository: beeware/briefcase-linux-system-template
runner-os: ubuntu-22.04
target-platform: linux
target-format: system
framework: ${{ matrix.framework }}
strategy:
fail-fast: false
matrix:
framework: [ toga, pyside6, pygame, console ]
test-verify-apps-appimage-templates:
name: Verify AppImage
needs: pre-commit
uses: ./.github/workflows/app-build-verify.yml
with:
python-version: "3.11"
repository: beeware/briefcase-linux-appimage-template
runner-os: ubuntu-latest
target-platform: linux
target-format: appimage
framework: ${{ matrix.framework }}
strategy:
fail-fast: false
matrix:
# 2024-07-11 (beeware/briefcase#1908): pyside6 segfaults on AppImage start.
framework: [ toga, pygame, console ]
test-verify-apps-flatpak-templates:
name: Verify Flatpak
needs: pre-commit
uses: ./.github/workflows/app-build-verify.yml
with:
python-version: "3.11"
repository: beeware/briefcase-linux-flatpak-template
runner-os: ubuntu-latest
target-platform: linux
target-format: flatpak
framework: ${{ matrix.framework }}
strategy:
fail-fast: false
matrix:
framework: [ toga, pyside6, pygame, console ]
test-verify-apps-macOS-templates:
name: Verify macOS
needs: pre-commit
uses: ./.github/workflows/app-build-verify.yml
with:
python-version: "3.11"
repository: beeware/briefcase-macos-${{ matrix.format }}-template
runner-os: macos-latest
target-platform: macOS
target-format: ${{ matrix.format }}
framework: ${{ matrix.framework }}
strategy:
fail-fast: false
matrix:
framework: [ toga, pyside6, pygame, console ]
format: [ app, Xcode ]
test-verify-apps-web-templates:
name: Verify Web
needs: pre-commit
uses: ./.github/workflows/app-build-verify.yml
with:
python-version: "3.11"
repository: beeware/briefcase-web-static-template
runner-os: ubuntu-latest
target-platform: web
target-format: static
framework: ${{ matrix.framework }}
strategy:
fail-fast: false
matrix:
framework: [ toga ] # toga only
test-verify-apps-windows-templates:
name: Verify Windows
needs: pre-commit
uses: ./.github/workflows/app-build-verify.yml
with:
python-version: "3.11"
repository: beeware/briefcase-windows-${{ matrix.format }}-template
runner-os: windows-latest
target-platform: windows
target-format: ${{ matrix.format }}
framework: ${{ matrix.framework }}
strategy:
fail-fast: false
matrix:
framework: [ toga, pyside6, pygame, console ]
format: [ app, VisualStudio ]