-
-
Notifications
You must be signed in to change notification settings - Fork 7
51 lines (40 loc) · 1.33 KB
/
ci.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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# Run at 5:00 on Friday to detect broken dependencies and such
- cron: '0 5 * * 5'
jobs:
test:
if: ${{ github.event_name != 'release' || github.event.action != 'published' }}
strategy:
matrix:
dart_version: ["3.0", "3.0"]
runs-on: ubuntu-latest
container:
image: dart:${{ matrix.dart_version }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2 # needed by codecov
- name: Install dependencies
# The $(command -v pub...) is a hack so the dart "prefix" is only used
# when the pub command is not present
run: $(command -v pub || echo dart pub) get
- name: Analyze
run: dart analyze --fatal-infos
- name: Run tests
run: $(command -v pub || echo dart pub) run test --coverage=./coverage
- name: Convert coverage to LCOV
run: $(command -v pub || echo dart pub) run coverage:format_coverage
--lcov --packages=.dart_tool/package_config.json --report-on=lib
-i coverage -o coverage/lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: coverage/lcov.info
flags: unit,dart${{ matrix.dart_version }}