-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (63 loc) · 1.64 KB
/
test.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
name: Test
on:
pull_request:
types:
- opened
- synchronize
push:
branches:
- main
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
sdk: [stable, beta, 2.17.0]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Download dart sdk
uses: dart-lang/[email protected]
with:
sdk: ${{ matrix.sdk }}
- name: Install dependencies
run: dart pub get
- name: Format code
run: dart format --set-exit-if-changed .
- name: Static analyze project
run: dart analyze --fatal-infos --fatal-warnings lib
- name: Run tests
run: dart test
coverage:
name: Coverage
needs:
- test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Download dart sdk
uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: Install dependencies
run: dart pub get
- name: Run tests
run: dart test --coverage=coverage
- name: Convert coverage to ICOV
run: dart run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
file: coverage/lcov.info
fail_ci_if_error: true
flags: unittests
verbose: true