-
Notifications
You must be signed in to change notification settings - Fork 11
65 lines (49 loc) · 1.71 KB
/
test.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
60
61
62
63
64
65
name: Test
on:
push:
branches:
- '**'
- '!gh-pages'
jobs:
Lint:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
- name: Setup 🔨
uses: cedx/setup-dart@v2
- name: Get dependencies 📥
run: pub get
- name: Analyze 🔍
run: make lint
Unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
- name: Setup 🔨
uses: cedx/setup-dart@v2
- name: Get dependencies 📥
run: pub get
- name: Test 🔧
run: |
pub global activate coverage
dart scripts/collect_tests.dart
pub run test --coverage=coverage test/.test_coverage.dart
pub global run coverage:format_coverage --packages=.packages -i coverage/test/.test_coverage.dart.vm.json --lcov > coverage/lcov.info
- name: Clean coverage 🧹
run: |
pub global activate remove_from_coverage
# Exclude the .pub-cache
pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '/.pub-cache/'
# Exclude all g.dart files
pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '.g.dart$'
# Exclude the proto files
pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '/lib/proto/'
# Exclude the test folder
pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '/test/'
- name: Upload coverage 📤
uses: codecov/codecov-action@v1
with:
file: coverage/lcov.info
fail_ci_if_error: true