-
Notifications
You must be signed in to change notification settings - Fork 23
47 lines (40 loc) · 1.11 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
name: Run tests
on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- main
schedule:
- cron: "0 0 * * 0" # Run on Sundays
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || ''}}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Restore Dart cache
id: restore-dart-cache
uses: actions/cache/restore@v3
with:
path: .dart_tool
key: ${{ runner.os }}-dart-${{ hashFiles('**/pubspec.lock') }}-
- run: flutter pub get --enforce-lockfile
- run: dart format --set-exit-if-changed .
- run: dart run build_runner build # Generate mocks
- run: flutter analyze .
- run: flutter test
- name: Save Dart cache
uses: actions/cache/save@v3
with:
path: .dart_tool
key: ${{ runner.os }}-dart-${{ hashFiles('**/pubspec.lock') }}-${{ github.run_id }}