73 lines (59 loc) · 1.7 KB
/
rad_core.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
66
67
68
69
70
71
72
73
name: Build, lint and test
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
analyze:
runs-on: ubuntu-latest
name: Analyze
strategy:
matrix:
dart-sdk-version: [3.2.0]
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.dart-sdk-version }}
- name: Run analyze
run: |
cd packages/rad
dart pub get
# exclude templates from formatter/analyzer, the right way
rm -rfd test/templates
dart format --output=none --set-exit-if-changed .
dart analyze --fatal-infos
tests:
runs-on: ubuntu-latest
name: Run tests
strategy:
matrix:
dart-sdk-version: [2.17.0, 3.0.0]
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.dart-sdk-version }}
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Generate tests
run: |
cd packages/rad/test
python3 scripts/main.py gen
- name: Run tests
run: |
cd packages/rad
dart pub get
dart pub run test --coverage="coverage"
dart pub global activate coverage
$HOME/.pub-cache/bin/format_coverage --lcov --in=coverage --out=rad.lcov --report-on=lib
mv rad.lcov ../../rad.dart.${{ matrix.dart-sdk-version }}.lcov
- name: Publish to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: rad.dart.${{ matrix.dart-sdk-version }}.lcov
verbose: true