-
-
Notifications
You must be signed in to change notification settings - Fork 310
116 lines (92 loc) · 3.13 KB
/
build.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Build
on: [push, pull_request]
jobs:
build_dart_packages:
runs-on: ubuntu-latest
container:
image: dart:${{ matrix.version }}
strategy:
matrix:
package: ["mobx_codegen", "mobx"]
version: ["stable", "beta"]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
working-directory: ${{ matrix.package }}
run: dart pub get
- name: Analyze
working-directory: ${{ matrix.package }}
run: dart analyze --fatal-warnings --fatal-infos .
- name: Run tests
working-directory: ${{ matrix.package }}
run: ../tool/coverage.sh
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.package }}
files: ./${{ matrix.package }}/coverage/lcov.txt
build_flutter_packages:
runs-on: ubuntu-latest
strategy:
matrix:
package: ["flutter_mobx"]
channel: ["stable", "beta"]
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.channel }}
- name: Install dependencies
run: flutter packages get
working-directory: ${{ matrix.package }}
- name: Analyze
run: flutter analyze
working-directory: ${{ matrix.package }}
- name: Run tests
run: flutter test --coverage --coverage-path coverage/lcov.txt
working-directory: ${{ matrix.package }}
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.package }}
files: ./${{ matrix.package }}/coverage/lcov.txt
build_lint_packages:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ matrix.package }}
strategy:
matrix:
package: ["mobx_lint"] #"mobx_lint_flutter_test"] - skipping as its failing builds
version: ["stable"]
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.channel }}
- name: Add pub cache bin to PATH
run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Add pub cache to PATH
run: echo "PUB_CACHE="$HOME/.pub-cache"" >> $GITHUB_ENV
- name: Install dependencies
run: flutter pub get
- run: dart pub global activate custom_lint
- name: Analyze
run: flutter analyze
- name: Run custom_lint
run: custom_lint
# Workaround to https://github.com/invertase/dart_custom_lint/issues/77
if: matrix.package == 'mobx_lint_flutter_test'
- name: Run tests
if: matrix.package == 'mobx_lint_flutter_test'
# Workaround to https://github.com/dart-lang/sdk/issues/53530
run: ../tool/coverage.sh
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
if: matrix.package == 'mobx_lint_flutter_test'
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: mobx_lint
files: coverage/lcov.txt