This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
205 lines (162 loc) · 5.77 KB
/
CI.yaml
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
name: CI
on:
push:
branches:
- trunk
pull_request:
branches:
- trunk
permissions: # added using https://github.com/step-security/secure-workflows
contents: write # required for stefanzweifel/git-auto-commit-action
jobs:
build:
runs-on: ubuntu-latest
outputs:
commit_ref: ${{ steps.commit_id.outputs.changes_detected && steps.commit_id.outputs.commit_hash || github.ref }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: subosito/flutter-action@cc97e1648fff6ca5cc647fa67f47e70f7895510b # v2.11.0
with:
channel: "stable"
cache: true
cache-key: ${{ format('flutter-{0}', github.ref) }}
- run: flutter --version
- uses: ./.github/composite/install_dependencies_job
- uses: ./.github/composite/build_job
- uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0
id: commit_id
with:
commit_message: "chore: automated build"
- run: echo ${{ steps.commit_id.outputs.commit_hash }}
at_app_bundler:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ needs.build.outputs.commit_ref }}
- uses: subosito/flutter-action@cc97e1648fff6ca5cc647fa67f47e70f7895510b # v2.11.0
with:
channel: "stable"
cache: true
cache-key: ${{ format('flutter-{0}', github.ref) }}
- run: dart run melos bootstrap
- name: Dart Analyze
working-directory: ./packages/at_app_bundler
# The mason brick in at_app_bundler is not valid dart code
# Must analyze each directory individually
run: |
dart analyze ./lib
dart analyze ./bin
at_app_create:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ needs.build.outputs.commit_ref }}
- uses: subosito/flutter-action@cc97e1648fff6ca5cc647fa67f47e70f7895510b # v2.11.0
with:
channel: "stable"
cache: true
cache-key: ${{ format('flutter-{0}', github.ref) }}
- run: dart run melos bootstrap
- name: Dart Analyze
working-directory: ./packages/at_app_create
run: dart analyze
at_app_flutter:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ needs.build.outputs.commit_ref }}
- uses: subosito/flutter-action@cc97e1648fff6ca5cc647fa67f47e70f7895510b # v2.11.0
with:
channel: "stable"
cache: true
cache-key: ${{ format('flutter-{0}', github.ref) }}
- run: dart run melos bootstrap
- name: Dart Analyze
working-directory: ./packages/at_app_flutter
run: dart analyze
- name: Unit Tests
working-directory: ./packages/at_app_flutter
run: flutter test --no-pub
at_app:
needs: build
runs-on: ubuntu-latest
outputs:
build_key: ${{ needs.build.outputs.build_key }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ needs.build.outputs.commit_ref }}
- uses: subosito/flutter-action@cc97e1648fff6ca5cc647fa67f47e70f7895510b # v2.11.0
with:
channel: "stable"
cache: true
cache-key: ${{ format('flutter-{0}', github.ref) }}
- run: dart run melos bootstrap
- name: Dart Analyze
working-directory: ./packages/at_app
run: dart analyze
- name: Unit Tests
working-directory: ./packages/at_app
run: flutter test --no-pub
# GENERATED APP TESTS
generated_template_app:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ needs.build.outputs.commit_ref }}
- uses: subosito/flutter-action@cc97e1648fff6ca5cc647fa67f47e70f7895510b # v2.11.0
with:
channel: "stable"
cache: true
cache-key: ${{ format('flutter-{0}', github.ref) }}
- run: dart run melos bootstrap
- uses: ./.github/composite/generated_app_job
generated_demo_apps:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name:
- chit_chat
- snackbar
- snackbar_sender
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ needs.build.outputs.commit_ref }}
- uses: subosito/flutter-action@cc97e1648fff6ca5cc647fa67f47e70f7895510b # v2.11.0
with:
channel: "stable"
cache: true
cache-key: ${{ format('flutter-{0}', github.ref) }}
- run: dart run melos bootstrap
- uses: ./.github/composite/generated_app_job
with:
name: ${{ matrix.name }}
dispose:
runs-on: ubuntu-latest
if: ${{ always() }} # Always dispose, regardless of whether jobs pass or fail
needs: # Needs everything to run before we dispose
- build
- at_app_bundler
- at_app_create
- at_app_flutter
- at_app
- generated_template_app
- generated_demo_apps
steps:
- name: Dispose of temporary branch
if: ${{ github.event.pull_request && github.event.pull_request.head.repo.full_name != github.repository }}
uses: dawidd6/action-delete-branch@d1efac9a6f7a9b408d4e8ff663a99c1fbac17b3f # v3
with:
github_token: ${{ github.token }}
branches: ${{ format('build_action-{0}-{1}', github.run_id, github.run_attempt) }}