Skip to content

Commit eafb766

Browse files
Merge pull request #152 from flutter-form-builder-ecosystem/improve-ci
ci: modify to use common pipelines
2 parents 17e982b + 55e293f commit eafb766

File tree

2 files changed

+60
-91
lines changed

2 files changed

+60
-91
lines changed

.github/workflows/base-beta.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Base (beta)
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 */15 * *' # Runs every 15 days for verifying changes on Flutter beta channel
6+
push:
7+
branches: [beta]
8+
tags:
9+
- '[0-9]+.[0-9]+.[0-9]+-*'
10+
11+
pull_request:
12+
branches: [beta]
13+
14+
workflow_dispatch:
15+
16+
# This ensures that previous jobs for the PR are canceled when PR is updated
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
build:
23+
uses: flutter-form-builder-ecosystem/.github/.github/workflows/minimal-quality.yaml@main
24+
with:
25+
codecov-name: form_builder_validators
26+
fvm-flavor: beta
27+
enable-generate-l10n: true
28+
example:
29+
uses: flutter-form-builder-ecosystem/.github/.github/workflows/build-examples.yaml@main
30+
with:
31+
fvm-flavor: beta
32+
enable-generate-l10n: true
33+
34+
35+
deployment:
36+
permissions:
37+
id-token: write
38+
uses: flutter-form-builder-ecosystem/.github/.github/workflows/deployment.yaml@main
39+
with:
40+
enable-generate-l10n: true
41+
if: ${{ github.ref_type == 'tag' }}
42+
needs: [build, example]

.github/workflows/base.yaml

Lines changed: 18 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
name: CI & CD
1+
name: Base
22

33
on:
4-
workflow_dispatch:
5-
64
push:
75
branches: [main]
86
tags:
9-
- "[0-9]+.[0-9]+.[0-9]+*"
7+
- '[0-9]+.[0-9]+.[0-9]+'
108

119
pull_request:
10+
branches: [main]
11+
12+
workflow_dispatch:
1213

1314
# This ensures that previous jobs for the PR are canceled when PR is updated
1415
concurrency:
@@ -17,95 +18,21 @@ concurrency:
1718

1819
jobs:
1920
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
6225
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+
8530

8631
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
9232
permissions:
9333
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

Comments
 (0)