forked from flutter/gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (70 loc) · 2.37 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
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@dbf1fa04f4d2e52c33185153d06cdb5443aa189d
with:
channel: master
- run: flutter doctor -v
# Checkout gallery code and get packages.
- name: Checkout gallery code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: flutter pub get -v
# Analyze, check formatting, and run unit tests.
- run: flutter analyze
- name: Ensure the Dart code is formatted correctly
run: flutter format --set-exit-if-changed --dry-run .
- 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@dbf1fa04f4d2e52c33185153d06cdb5443aa189d
with:
channel: master
- run: flutter doctor -v
- run: flutter config --enable-web
# Checkout gallery code and get packages.
- name: Checkout gallery code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: flutter pub get -v
- 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@dbf1fa04f4d2e52c33185153d06cdb5443aa189d
with:
channel: master
- run: flutter doctor -v
# Checkout gallery code and get packages.
- name: Checkout gallery code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: flutter pub get -v
# Run the golden tests and upload failed test artifacts.
- run: flutter test test_goldens
- name: Upload goldens if tests fail
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8
if: failure()
with:
name: goldens
path: test_goldens/failures/