-
Notifications
You must be signed in to change notification settings - Fork 3
85 lines (73 loc) · 2.22 KB
/
build.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
name: Build
on:
push:
branches:
- main
pull_request:
schedule:
# runs the CI everyday at 10AM
- cron: '0 10 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- packages/flutterfire_gen
- packages/flutterfire_gen_annotation
- packages/flutterfire_gen_utils
channel:
- master
- stable
dependencies:
- get
- downgrade
exclude:
- channel: master
dependencies: downgrade
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.channel }}
cache: ${{ matrix.channel == 'stable' }}
# It is executed separately
- name: Removing example folder
run: rm -rf example
working-directory: ${{ matrix.package }}
- name: Install dependencies
run: |
flutter pub ${{ matrix.dependencies }}
working-directory: ${{ matrix.package }}
- name: Check format
# Check dart format only on master
if: matrix.channel == 'master'
run: dart format --set-exit-if-changed .
working-directory: ${{ matrix.package }}
- name: Generate
run: |
if grep -q build_runner "pubspec.yaml"; then
flutter pub run build_runner build --delete-conflicting-outputs
fi
working-directory: ${{ matrix.package }}
- name: Analyze
run: flutter analyze
working-directory: ${{ matrix.package }}
- name: Run tests
run: |
if grep -q "name: example" "pubspec.yaml"; then
flutter test --coverage
else
dart test --coverage=./coverage
dart run coverage:format_coverage --lcov --in=./coverage --out=./coverage/lcov.info --report-on=lib
fi
working-directory: ${{ matrix.package }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
fail_ci_if_error: true
flags: unittests
name: codecov-umbrella
working-directory: ${{ matrix.package }}