-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (70 loc) · 2.52 KB
/
main.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
name: main
on:
workflow_dispatch:
inputs:
skip-tests:
description: Skip tests
required: false
default: false
type: boolean
skip-build-app:
description: Skip build-app
required: false
default: false
type: boolean
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
paths-filter:
name: 'Paths Filter'
uses: ./.github/workflows/paths-filter.yml
tests:
name: 'Tests'
needs: [paths-filter]
if: ${{ !inputs.skip-tests && github.event.pull_request.draft != true && needs.paths-filter.outputs.should-test != 'false' }}
uses: grigorye/ReusableWorkflows/.github/workflows/tests-generic.yml@v20
secrets: inherit
with:
runs-on: 'macos-12'
unit-tests-scheme: 'TMBuddyTests'
snapshot-tests-scheme: 'TMBuddySnapshots'
ui-snapshot-tests-scheme: 'TMBuddyUITestSnapshots'
build-app:
name: 'App'
needs: [paths-filter]
if: ${{ !inputs.skip-build-app && github.event.pull_request.draft != true && needs.paths-filter.outputs.should-build != 'false' }}
uses: grigorye/ReusableWorkflows/.github/workflows/build-app-generic.yml@v20
with:
macos-app-scheme: 'TMBuddy'
build-configs: '[\"app-store\", \"developer-id\"]'
secrets: inherit
finalize:
name: 'Finalize Run'
if: always()
needs: [paths-filter, tests, build-app]
runs-on: ubuntu-latest
steps:
- name: 'Flag non-succeeding app builds'
if: always() && needs.paths-filter.outputs.should-build != 'false' && needs.build-app.result != 'success'
uses: actions/github-script@v6
with:
script: |
core.setFailed('Some app build did not succeed.')
- name: 'Flag tests that did not run'
if: always() && needs.paths-filter.outputs.should-test != 'false' && needs.tests.result != 'success'
uses: actions/github-script@v6
with:
script: |
core.setFailed('Some tests did not run.')
- name: 'Flag tests that did fail'
if: always() && needs.paths-filter.outputs.should-test != 'false' && needs.tests.outputs.tests-passed != 'true'
uses: actions/github-script@v6
with:
script: |
core.setFailed('Some tests did fail.')
- name: 'Report success for skipped jobs'
if: always() && needs.paths-filter.outputs.should-test == 'false' && needs.paths-filter.outputs.should-build == 'false'
run: |
echo 'No job to do.'