1
- name : CI & CD
1
+ name : Base
2
2
3
3
on :
4
- workflow_dispatch :
5
-
6
4
push :
7
5
branches : [main]
8
6
tags :
9
- - " [0-9]+.[0-9]+.[0-9]+* "
7
+ - ' [0-9]+.[0-9]+.[0-9]+'
10
8
11
9
pull_request :
10
+ branches : [main]
11
+
12
+ workflow_dispatch :
12
13
13
14
# This ensures that previous jobs for the PR are canceled when PR is updated
14
15
concurrency :
@@ -17,95 +18,21 @@ concurrency:
17
18
18
19
jobs :
19
20
build :
20
- name : Build package & run tests
21
- runs-on : ubuntu-latest
22
- strategy :
23
- matrix :
24
- flutter-version : [stable, beta]
25
-
26
- steps :
27
- - name : Checkout repository
28
- uses : actions/checkout@v4
29
- with :
30
- fetch-depth : 1 # Use shallow clone for faster checkout
31
- - name : Check broken links
32
- uses : JustinBeckwith/linkinator-action@v1
33
- with :
34
- paths : " **/*.md"
35
- - name : Setup Flutter
36
- uses : kuhnroyal/flutter-fvm-config-action/setup@v3
37
- with :
38
- path : ' .fvmrc'
39
- flavor : ${{ matrix.flutter-version }}
40
- - name : Install dependencies
41
- run : dart pub get
42
- - name : Run l10n
43
- run : flutter gen-l10n
44
- - name : Run l10n on example
45
- run : flutter gen-l10n
46
- working-directory : example
47
- - name : Format code
48
- run : dart format --set-exit-if-changed $(find . -name "*.dart" ! \( -wholename "./lib/localization/intl/*" -or -wholename "./example/lib/localization/intl/*" \))
49
- - name : Analyze static code
50
- run : dart analyze
51
- - name : Run tests
52
- run : flutter test --no-pub --coverage
53
- - name : Check publish warnings
54
- run : dart pub publish --dry-run
55
- - name : Upload coverage to Codecov
56
- uses : codecov/codecov-action@v5
57
- with :
58
- files : coverage/lcov.info
59
- flags : unittests
60
- name : form_builder_validators
61
-
21
+ uses : flutter-form-builder-ecosystem/.github/.github/workflows/minimal-quality.yaml@main
22
+ with :
23
+ codecov-name : form_builder_validators
24
+ enable-generate-l10n : true
62
25
example :
63
- name : Build example app
64
- runs-on : ubuntu-latest
65
- steps :
66
- - name : Checkout repository
67
- uses : actions/checkout@v4
68
- with :
69
- fetch-depth : 1 # Use shallow clone for faster checkout
70
- - name : Setup Flutter
71
- uses : kuhnroyal/flutter-fvm-config-action/setup@v3
72
- with :
73
- path : ' .fvmrc'
74
- flavor : ' stable'
75
- - name : Install dependencies
76
- run : dart pub get
77
- - name : Run l10n
78
- run : flutter gen-l10n
79
- - name : Run l10n on example
80
- run : flutter gen-l10n
81
- working-directory : example
82
- - name : Build example
83
- run : flutter build appbundle --debug
84
- working-directory : example
26
+ uses : flutter-form-builder-ecosystem/.github/.github/workflows/build-examples.yaml@main
27
+ with :
28
+ enable-generate-l10n : true
29
+
85
30
86
31
deployment :
87
- # Don't use because need generate l10n before publish
88
- # uses: flutter-form-builder-ecosystem/.github/.github/workflows/deployment.yaml@main
89
- if : ${{ github.ref_type == 'tag' }}
90
- needs : [build, example]
91
- name : Deploy package
92
32
permissions :
93
33
id-token : write
94
- runs-on : ubuntu-latest
95
- steps :
96
- - name : Checkout repository
97
- uses : actions/checkout@v4
98
- with :
99
- fetch-depth : 1 # Use shallow clone for faster checkout
100
- - uses : dart-lang/setup-dart@v1
101
- - name : Setup Flutter
102
- uses : kuhnroyal/flutter-fvm-config-action/setup@v3
103
- with :
104
- path : ' .fvmrc'
105
- flavor : ' stable'
106
- - name : Install dependencies
107
- run : dart pub get
108
- - name : Run l10n
109
- run : flutter gen-l10n
110
- - name : Publish package
111
- run : dart pub publish -v -f
34
+ uses : flutter-form-builder-ecosystem/.github/.github/workflows/deployment.yaml@main
35
+ with :
36
+ enable-generate-l10n : true
37
+ if : ${{ github.ref_type == 'tag' }}
38
+ needs : [build, example]
0 commit comments