-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (78 loc) · 2.6 KB
/
Copy pathcheck-flutter.yml
File metadata and controls
93 lines (78 loc) · 2.6 KB
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
name: check flutter
on:
workflow_call:
jobs:
format:
name: format
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
persist-credentials: false
- name: Set up Flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2
with:
channel: stable
flutter-version-file: pubspec.yaml
cache: true
- name: Install dependencies
run: flutter pub get --enforce-lockfile
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
persist-credentials: false
- name: Set up Flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2
with:
channel: stable
flutter-version-file: pubspec.yaml
cache: true
- name: Install dependencies
run: flutter pub get --enforce-lockfile
# Runs before the root analyze: resolving each package also gives the
# root analyzer a package config for the nested contexts it discovers.
- name: Check local package lints
run: |
set -euo pipefail
for package in packages/*/; do
[ -f "${package}pubspec.yaml" ] || continue
(cd "$package" && dart pub get && dart analyze --fatal-infos)
done
- name: Check lints
run: flutter analyze
test:
name: test
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
persist-credentials: false
- name: Set up Flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2
with:
channel: stable
flutter-version-file: pubspec.yaml
cache: true
- name: Install dependencies
run: flutter pub get --enforce-lockfile
- name: Run tests
run: flutter test
- name: Run local package tests
run: |
set -euo pipefail
for package in packages/*/; do
[ -d "${package}test" ] || continue
if grep -qE '^\s+sdk:\s*flutter\s*$' "${package}pubspec.yaml"; then
(cd "$package" && flutter pub get && flutter test)
else
(cd "$package" && dart pub get && dart test)
fi
done