-
-
Notifications
You must be signed in to change notification settings - Fork 99
158 lines (126 loc) · 4.05 KB
/
base.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
name: CI & CD
on:
workflow_dispatch:
push:
branches: [main]
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
pull_request:
branches: [main]
# This ensures that previous jobs for the PR are canceled when PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build package & run tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1 # Use shallow clone for faster checkout
- name: Check broken links
uses: JustinBeckwith/linkinator-action@v1
with:
paths: "**/*.md"
- name: Get Flutter version by FVM
uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action
with:
path: ".fvmrc"
flavor: "stable"
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
architecture: x64
cache: true
- name: Install dependencies
run: dart pub get
- name: Run l10n
run: flutter gen-l10n
- name: Run l10n on example
run: flutter gen-l10n
working-directory: example
- name: Format code
run: dart format --set-exit-if-changed $(find . -name "*.dart" ! \( -wholename "./lib/localization/intl/*" -or -wholename "./example/lib/localization/intl/*" \))
- name: Analyze static code
run: dart analyze
- name: Run tests
run: flutter test --no-pub --coverage
- name: Check publish warnings
run: dart pub publish --dry-run
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: coverage/lcov.info
flags: unittests
name: form_builder_validators
example:
name: Build example app
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1 # Use shallow clone for faster checkout
- name: Get Flutter version by FVM
uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action
with:
path: ".fvmrc"
flavor: "stable"
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
architecture: x64
cache: true
- name: Install dependencies
run: dart pub get
- name: Run l10n
run: flutter gen-l10n
- name: Run l10n on example
run: flutter gen-l10n
working-directory: example
- name: Build example
run: flutter build appbundle --debug
working-directory: example
deployment:
if: ${{ github.ref_type == 'tag' }}
needs: [build, example]
name: Deploy package
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1 # Use shallow clone for faster checkout
- name: Set up Dart
uses: dart-lang/setup-dart@v1
- name: Get Flutter version by FVM
uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action
with:
path: ".fvmrc"
flavor: "stable"
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
architecture: x64
cache: true
- name: Install dependencies
run: dart pub get
- name: Run l10n
run: flutter gen-l10n
- name: Publish package
run: dart pub publish -v -f