-
Notifications
You must be signed in to change notification settings - Fork 2
122 lines (114 loc) · 3.26 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
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
117
118
119
120
121
122
name: Dart CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
code-quality:
runs-on: ubuntu-latest
strategy:
matrix:
flutter-channel: [stable, beta]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.flutter-channel }}
# TODO: Use custom_lint from hosted when https://github.com/invertase/dart_custom_lint/pull/272 lands
- run: |
dart pub global activate puby
dart pub global activate -sgit https://github.com/Rexios80/dart_custom_lint --git-ref f62fe2e1dc03162d1bb55dbba7e6b37bc08d81a1 --git-path packages/custom_lint
puby link
dart format . --set-exit-if-changed
dart analyze --fatal-infos
custom_lint
test-hive:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- test-platform: vm
compiler: kernel
- test-platform: chrome
compiler: dart2js
- test-platform: chrome
compiler: dart2wasm
defaults:
run:
working-directory: hive
steps:
- uses: actions/checkout@v4
- uses: browser-actions/setup-chrome@v1
if: ${{ matrix.test-platform == 'chrome' }}
- uses: dart-lang/setup-dart@v1
with:
sdk: 3.4.0
# rexios_lints requires a newer SDK
- name: Remove rexios_lints
run: |
sed -i '/rexios_lints: \^.*$/d' pubspec.yaml
- name: Install dependencies
run: dart pub get
- name: Run tests
run: dart test -p ${{ matrix.test-platform }} -c ${{ matrix.compiler }}
test-hive-flutter:
runs-on: ubuntu-latest
strategy:
matrix:
flutter-channel: [stable, beta]
defaults:
run:
working-directory: hive_flutter
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.flutter-channel }}
- name: Install dependencies
run: flutter pub get
- name: Run tests
run: flutter test
test-hive_generator:
runs-on: ubuntu-latest
strategy:
matrix:
flutter-channel: [stable, beta]
defaults:
run:
working-directory: hive_generator
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.flutter-channel }}
- name: Install dependencies
run: dart pub get
- name: Generate build_runner output
run: dart pub run build_runner build --delete-conflicting-outputs
ensure-codegen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- run: |
dart pub global activate puby
puby link
puby gen
git diff --exit-code
check-score:
runs-on: ubuntu-latest
strategy:
matrix:
package: [hive, hive_generator, hive_flutter]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- run: |
cd ${{ matrix.package }}
flutter pub get
dart pub global activate pana
pana --no-warning --exit-code-threshold 0