1
- name : Base
1
+ name : CI & CD
2
2
3
3
on :
4
4
workflow_dispatch :
5
-
5
+
6
6
push :
7
7
branches : [main]
8
8
tags :
9
- - ' [0-9]+.[0-9]+.[0-9]+*'
9
+ - " [0-9]+.[0-9]+.[0-9]+*"
10
10
11
11
pull_request :
12
12
branches : [main]
@@ -18,27 +18,25 @@ concurrency:
18
18
19
19
jobs :
20
20
build :
21
+ name : Build package & run tests
21
22
runs-on : ubuntu-latest
22
23
23
24
steps :
24
- - uses : actions/checkout@v4
25
+ - name : Checkout repository
26
+ uses : actions/checkout@v4
27
+ with :
28
+ fetch-depth : 1 # Use shallow clone for faster checkout
25
29
26
30
- name : Check broken links
27
31
uses : JustinBeckwith/linkinator-action@v1
28
32
with :
29
33
paths : " **/*.md"
30
34
31
- - name : Get Flutter version by FVM
32
- uses : kuhnroyal/flutter-fvm-config-action@v2
33
- id : fvm-config-action
34
- with :
35
- path : ' .fvmrc'
36
- flavor : ' stable'
37
-
38
- - uses : subosito/flutter-action@v2
35
+ - name : Set up Flutter
36
+ uses : subosito/flutter-action@v2
39
37
with :
40
- flutter-version : ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
41
- channel : ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
38
+ channel : " stable "
39
+ architecture : x64
42
40
cache : true
43
41
44
42
- name : Install dependencies
48
46
run : flutter gen-l10n
49
47
50
48
- name : Run l10n on example
51
- run : |
52
- cd example
53
- flutter gen-l10n
49
+ run : flutter gen-l10n
50
+ working-directory : example
54
51
55
52
- name : Format code
56
53
run : dart format --set-exit-if-changed $(find . -name "*.dart" ! \( -wholename "./lib/localization/intl/*" -or -wholename "./example/lib/localization/intl/*" \))
@@ -59,16 +56,11 @@ jobs:
59
56
run : dart analyze
60
57
61
58
- name : Run tests
62
- run : flutter test --coverage
59
+ run : flutter test --no-pub -- coverage
63
60
64
61
- name : Check publish warnings
65
62
run : dart pub publish --dry-run
66
63
67
- - name : Build example
68
- run : |
69
- cd example
70
- flutter build appbundle --debug
71
-
72
64
- name : Upload coverage to Codecov
73
65
uses : codecov/codecov-action@v4
74
66
env :
@@ -78,23 +70,58 @@ jobs:
78
70
flags : unittests
79
71
name : form_builder_validators
80
72
73
+ example :
74
+ name : Build example app
75
+ runs-on : ubuntu-latest
76
+
77
+ steps :
78
+ - name : Checkout repository
79
+ uses : actions/checkout@v4
80
+ with :
81
+ fetch-depth : 1 # Use shallow clone for faster checkout
82
+
83
+ - name : Set up Flutter
84
+ uses : subosito/flutter-action@v2
85
+ with :
86
+ channel : " stable"
87
+ architecture : x64
88
+ cache : true
89
+
90
+ - name : Install dependencies
91
+ run : dart pub get
92
+
93
+ - name : Run l10n
94
+ run : flutter gen-l10n
95
+
96
+ - name : Run l10n on example
97
+ run : flutter gen-l10n
98
+ working-directory : example
99
+
100
+ - name : Build example
101
+ run : flutter build appbundle --debug
102
+ working-directory : example
103
+
81
104
deployment :
82
105
if : ${{ github.ref_type == 'tag' }}
83
- needs : build
106
+ needs : [ build, example]
84
107
name : Deploy package
85
108
permissions :
86
109
id-token : write
87
110
runs-on : ubuntu-latest
88
111
steps :
89
- - uses : actions/checkout@v4
112
+ - name : Checkout repository
113
+ uses : actions/checkout@v4
114
+ with :
115
+ fetch-depth : 1 # Use shallow clone for faster checkout
90
116
91
- - uses : dart-lang/setup-dart@v1
117
+ - name : Set up Dart
118
+ uses : dart-lang/setup-dart@v1
92
119
93
- - name : Flutter action
120
+ - name : Set up Flutter
94
121
uses : subosito/flutter-action@v2
95
122
with :
96
- channel : ' stable'
97
- # use the build-in cache from Subosito
123
+ channel : " stable"
124
+ architecture : x64
98
125
cache : true
99
126
100
127
- name : Install dependencies
@@ -105,4 +132,3 @@ jobs:
105
132
106
133
- name : Publish package
107
134
run : dart pub publish -v -f
108
-
0 commit comments