-
-
Notifications
You must be signed in to change notification settings - Fork 0
335 lines (313 loc) Β· 10.3 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
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
---
name: CI/CD
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
merge_group:
schedule:
- cron: "0 14 * * 1" # every monday at 9 in the morning CST
workflow_dispatch:
env:
CI: true
permissions:
contents: read
jobs:
setup:
name: Setup
needs: []
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: π Git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: π¦ Set up Flutter
id: flutter
uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 # v2.17.0
with:
flutter-version-file: pubspec.yaml
cache: true
- name: π Disable analytics
run: flutter --disable-analytics
- name: π¦ Install dependencies
run: flutter pub get
- name: βοΈ Cache generated files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
.dart_tool/
lib/gen/*.gen.dart
lib/src/features/**/*.g.dart
lib/src/features/**/*.freezed.dart
lib/src/utils/*.g.dart
lib/src/utils/*.freezed.dart
lib/src/app/*.gr.dart
lib/src/app/*.gm.dart
lib/src/l10n/app_localizations.dart
lib/src/l10n/app_localizations_*.dart
key: ${{ runner.os }}-${{ steps.flutter.outputs.CHANNEL }}-dart-${{ hashFiles('**/build.yaml') }}
- name: π Generate files
run: |
flutter gen-l10n
dart run build_runner build -d
build:
name: Build
needs: ["setup"]
timeout-minutes: ${{ (matrix.target == 'web') && 5 || 10 }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
target:
- web
- appbundle
# - ios
# - macos
# - windows
include:
- target: web
os: ubuntu-latest
flutter-flags: --release
- target: appbundle
os: ubuntu-latest
flutter-flags: --debug --no-tree-shake-icons --no-shrink
# - target: ios
# os: macos-latest
# flutter-flags: --debug --no-tree-shake-icons
# - target: macos
# os: macos-latest
# flutter-flags: --debug --no-tree-shake-icons
# - target: windows
# os: windows-latest
# flutter-flags: --debug --no-tree-shake-icons
steps:
- name: π Git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: π¦ Set up Flutter
id: flutter
uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 # v2.17.0
with:
flutter-version-file: pubspec.yaml
cache: true
- name: π Disable analytics
run: flutter --disable-analytics
- name: π¦ Install dependencies
run: flutter pub get
- name: βοΈ Cache generated files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
.dart_tool/
lib/gen/*.gen.dart
lib/src/features/**/*.g.dart
lib/src/features/**/*.freezed.dart
lib/src/utils/*.g.dart
lib/src/utils/*.freezed.dart
lib/src/app/*.gr.dart
lib/src/app/*.gm.dart
lib/src/l10n/app_localizations.dart
lib/src/l10n/app_localizations_*.dart
key: ${{ runner.os }}-${{ steps.flutter.outputs.CHANNEL }}-dart-${{ hashFiles('**/build.yaml') }}
- name: π Generate files
run: |
flutter gen-l10n
dart run build_runner build -d
- name: π§ Build
run: |
flutter build ${{ matrix.target }} ${{ matrix.flutter-flags }}
# - name: βοΈ Upload build
# if: matrix.target == 'web'
# uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
# with:
# name: build-directory-${{ matrix.target }}-${{ steps.flutter.outputs.CHANNEL }}
# path: ./build
# if-no-files-found: error
lint:
name: Linting
needs: ["setup"]
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: π Git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: π¦ Set up Flutter
id: flutter
uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 # v2.17.0
with:
flutter-version-file: pubspec.yaml
cache: true
- name: π Disable analytics
run: flutter --disable-analytics
- name: π¦ Install dependencies
run: flutter pub get
- name: βοΈ Cache generated files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
.dart_tool/
lib/src/gen/*.gen.dart
lib/src/features/**/*.g.dart
lib/src/features/**/*.freezed.dart
lib/src/utils/*.g.dart
lib/src/utils/*.freezed.dart
lib/src/app/*.gr.dart
lib/src/app/*.gm.dart
lib/src/l10n/app_localizations.dart
lib/src/l10n/app_localizations_*.dart
key: ${{ runner.os }}-${{ steps.flutter.outputs.CHANNEL }}-dart-${{ hashFiles('**/build.yaml') }}
- name: π Generate files
run: |
flutter gen-l10n
dart run build_runner build -d
- name: π΅οΈ Analyze project source
run: flutter analyze --fatal-infos
- name: π΅οΈ Run Custom Lint Rules
run: dart run custom_lint --fatal-infos
test:
name: Testing
needs: ["setup"]
timeout-minutes: 7
runs-on: ubuntu-latest
steps:
- name: π Git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: π¦ Set up Flutter
id: flutter
uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 # v2.17.0
with:
flutter-version-file: pubspec.yaml
cache: true
- name: π Disable analytics
run: flutter --disable-analytics
- name: π¦ Install dependencies
run: flutter pub get
- name: βοΈ Cache generated files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
.dart_tool/
lib/src/gen/*.gen.dart
lib/src/features/**/*.g.dart
lib/src/features/**/*.freezed.dart
lib/src/utils/*.g.dart
lib/src/utils/*.freezed.dart
lib/src/app/*.gr.dart
lib/src/app/*.gm.dart
lib/src/l10n/app_localizations.dart
lib/src/l10n/app_localizations_*.dart
key: ${{ runner.os }}-${{ steps.flutter.outputs.CHANNEL }}-dart-${{ hashFiles('**/build.yaml') }}
- name: π Generate files
run: |
flutter gen-l10n
dart run build_runner build -d
- name: π§ͺ Run tests
run: dart run very_good_cli:very_good test --coverage --test-randomize-ordering-seed random
- name: π Check code coverage
uses: VeryGoodOpenSource/very_good_coverage@c953fca3e24a915e111cc6f55f03f756dcb3964c # v3.0.0
with:
path: coverage/lcov.info
min_coverage: 90 # 100
format:
name: Formatting
needs: ["setup"]
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- name: π Git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: π¦ Set up Flutter
id: flutter
uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 # v2.17.0
with:
flutter-version-file: pubspec.yaml
cache: true
- name: π Disable analytics
run: flutter --disable-analytics
- name: β¨ Verify formatting
run: dart format --output=none --set-exit-if-changed .
spell-check:
name: Check Spelling
needs: []
runs-on: ubuntu-latest
steps:
- name: π Git Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: πͺ Spell Check
uses: streetsidesoftware/cspell-action@9759be9ad475fe8145f8d2a1bf29a1c4d1c6f18d # v6.9.0
with:
files: |
**/*.md
**/*.dart
**/*.yaml
**/*.toml
**/*.json
incremental_files_only: false
link-check:
name: Check Links
needs: []
timeout-minutes: 2
runs-on: ubuntu-latest
steps:
- name: πͺ Link check
uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec # 1.0.15
with:
use-quiet-mode: "yes"
use-verbose-mode: "yes"
base-branch: "main"
markdownlint:
name: Lint Markdown
needs: []
timeout-minutes: 4
runs-on: ubuntu-latest
steps:
- name: π Git Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: π΅οΈ Markdown linting
uses: DavidAnson/markdownlint-cli2-action@eb5ca3ab411449c66620fe7f1b3c9e10547144b0 # v18.0.0
id: markdownlint
with:
fix: true
# Surprisingly, the default is to only lint the project root.
globs: |
**/*.md