-
Notifications
You must be signed in to change notification settings - Fork 3
138 lines (129 loc) · 3.44 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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:
package: [hive, hive_flutter, hive_generator]
flutter-channel: [stable, beta]
defaults:
run:
working-directory: ${{ matrix.package }}
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.flutter-channel }}
- run: |
dart pub get
dart format . --set-exit-if-changed
dart analyze --fatal-infos
dart run 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 --no-example
- 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:
strategy:
matrix:
include:
- flutter-channel: stable
os: ubuntu-latest
- flutter-channel: stable
# Test on windows since the generator directly accesses the file system
os: windows-latest
- flutter-channel: beta
os: ubuntu-latest
runs-on: ${{ matrix.os }}
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: Run tests
run: dart test
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
ensure-embedme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npx embedme **/*.md
git diff --exit-code
check-score:
runs-on: ubuntu-latest
strategy:
matrix:
package: [hive, hive_flutter, hive_generator]
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