-
Notifications
You must be signed in to change notification settings - Fork 87
156 lines (144 loc) · 4.62 KB
/
flutter_package.yml
File metadata and controls
156 lines (144 loc) · 4.62 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
name: Flutter Package Workflow
on:
workflow_call:
inputs:
analyze_directories:
required: false
type: string
default: "lib test"
collect_coverage_from:
required: false
type: string
default: "imports"
description: "Whether to collect coverage from imported files only or all files. Allowed values: imports, all."
concurrency:
required: false
type: number
default: 4
coverage_excludes:
required: false
type: string
default: ""
description: "Space-separated list of globs to exclude files from the coverage report (e.g. '**/*.g.dart **/gen/*.dart')."
flutter_channel:
required: false
type: string
default: "stable"
flutter_version:
required: false
type: string
default: ""
format_directories:
required: false
type: string
default: "lib test"
format_line_length:
required: false
type: string
min_coverage:
required: false
type: number
default: 100
package_get_excludes:
required: false
type: string
default: "!*"
platform:
required: false
type: string
default: ""
description: "The platform to run tests on (e.g., 'chrome', 'android', 'ios')."
report_on:
required: false
type: string
default: "lib"
run_bloc_lint:
required: false
type: boolean
default: true
run_skipped:
required: false
type: boolean
default: false
runs_on:
required: false
type: string
default: "ubuntu-latest"
setup:
required: false
type: string
default: ""
show_uncovered:
required: false
type: boolean
default: true
description: "Whether to show uncovered lines when coverage is below 100%."
test_optimization:
required: false
type: boolean
default: true
test_recursion:
required: false
type: boolean
default: false
working_directory:
required: false
type: string
default: "."
secrets:
ssh_key:
required: false
jobs:
build:
defaults:
run:
working-directory: ${{inputs.working_directory}}
runs-on: ${{inputs.runs_on}}
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v6
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2.23.0
with:
flutter-version: ${{inputs.flutter_version}}
channel: ${{inputs.flutter_channel}}
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- name: 🤫 Set SSH Key
env:
ssh_key: ${{secrets.ssh_key}}
if: env.ssh_key != null
uses: webfactory/ssh-agent@v0.10.0
with:
ssh-private-key: ${{secrets.ssh_key}}
- name: 📦 Install Dependencies
run: |
dart pub global activate very_good_cli 1.1.1
very_good packages get --recursive --ignore=${{inputs.package_get_excludes}}
- name: ⚙️ Run Setup
if: "${{inputs.setup != ''}}"
run: ${{inputs.setup}}
- name: ✨ Check Formatting
run: dart format ${{inputs.format_line_length && format('--line-length {0}', inputs.format_line_length) || ''}} --set-exit-if-changed ${{inputs.format_directories}}
- name: 🕵️ Analyze
run: flutter analyze ${{inputs.analyze_directories}}
- name: ✅ Bloc Lint
if: ${{inputs.run_bloc_lint}}
run: |
flutter pub global activate bloc_tools
bloc lint .
- name: 🧪 Run Tests
run: >-
very_good test
-j ${{inputs.concurrency}}
${{(inputs.test_recursion && '--recursive') || ''}}
${{(inputs.test_optimization && '--optimization') || '--no-optimization'}}
--coverage
--min-coverage ${{inputs.min_coverage}}
${{inputs.coverage_excludes != '' && format('--exclude-coverage "{0}"', inputs.coverage_excludes) || ''}}
${{format('--report-on "{0}"', inputs.report_on)}}
${{inputs.collect_coverage_from != 'imports' && format('--collect-coverage-from {0}', inputs.collect_coverage_from) || ''}}
${{inputs.show_uncovered && '--show-uncovered' || ''}}
${{inputs.run_skipped && '--run-skipped' || ''}}
${{inputs.platform != '' && format('--platform {0}', inputs.platform) || ''}}
--test-randomize-ordering-seed random