-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (47 loc) · 1.43 KB
/
tests.yml
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
name: Analyze and run tests
on:
push:
branches:
- master
paths:
- "**.dart"
- "!**.g.dart"
- "!**.freezed.dart"
pull_request:
branches:
- master
paths:
- "**.dart"
- "!**.g.dart"
- "!**.freezed.dart"
jobs:
build:
name: Analyze project source and run tests
runs-on: ubuntu-latest
steps:
- name: Install sqlite3
run: |
sudo apt-get -y install sqlite3
sqlite3 --version
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable' # or: 'stable', 'beta', 'main' or 'master'
cache: true
- run: flutter doctor -v
- name: Install dependencies from pub
run: flutter pub get
- name: Generate with build_runner
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Analyze project source
run: flutter analyze --no-fatal-infos
- name: Run tests and collect coverage
run: flutter test --coverage test/
- name: Clean coverage
run: |
sudo apt-get -y install lcov
lcov -r coverage/lcov.info -o coverage/lcov.info "lib/**.freezed.dart" "lib/**.g.dart" "lib/src/common/localization/*" --ignore-errors unused
- name: Upload to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}