This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
79 lines (69 loc) · 2.33 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
name: Tests
on:
push:
branches:
- main
pull_request:
# Declare default permissions as read only.
permissions: read-all
jobs:
unit-test:
name: Unit tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
channel: master
- run: flutter doctor -v
# Checkout gallery code and get packages.
- name: Checkout gallery code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- run: flutter pub get
# Analyze, check formatting, and run unit tests.
- run: flutter analyze
- name: Ensure the Dart code is formatted correctly
run: dart format --set-exit-if-changed .
- name: Run Flutter unit tests
run: flutter test
benchmark-test:
name: Benchmark tests
runs-on: ubuntu-latest
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
channel: master
- run: flutter doctor -v
# Checkout gallery code and get packages.
- name: Checkout gallery code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- run: flutter pub get
- run: flutter test test_benchmarks
golden-test:
name: Golden tests
runs-on: macos-latest
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
channel: master
- run: flutter doctor -v
# Checkout gallery code and get packages.
- name: Checkout gallery code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- run: flutter pub get
# Run the golden tests and upload failed test artifacts.
- run: flutter test test_goldens
- name: Upload goldens if tests fail
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
if: failure()
with:
name: goldens
path: test_goldens/failures/