-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (81 loc) · 2.98 KB
/
test-flutter.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
name: "analyze"
on: # rebuild any PRs and main branch changes
pull_request:
# branches: [ master ]
push:
branches:
- main # [ master ]
schedule:
- cron: "0 0 * * 0"
jobs:
# Check code formatting and static analysis on a single OS (linux)
# against Dart dev.
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest] # or: macos-latest, windows-latest
channel: [stable] # or: 'beta', 'dev' or 'master'
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.channel }}
- id: disabled_analytics_flutter
name: Disabled Analytics Flutter
run: flutter config --no-analytics
- id: disabled_analytics_dart
name: Disabled Analytics Dart
run: dart --disable-analytics
- id: checking_version_flutter
name: Check version Flutter is installed
run: flutter --version
- id: install_dependencies
name: Install dependencies
run: flutter pub get
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
# if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: dart analyze --fatal-infos
# if: always() && steps.install.outcome == 'success'
- id: install_very_good_cli
name: Install Very Good CLI
run: dart pub global activate very_good_cli
- name: Run tests with coverage
run: very_good test --coverage
# if: always() && steps.install.outcome == 'success'
- id: run_package_flutter_coverage_badge
name: Run package flutter_coverage_badge
run: flutter pub run flutter_coverage_badge
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: Andrés García
author_email: [email protected]
message: 'Updated coverage_badge.svg'
add: 'coverage_badge.svg'
- name: Upload coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage/lcov.info
# - uses: invertase/github-action-dart-analyzer@v1
# with:
# # (Optional) Treat info level issues as fatal.
# fatal-infos: false
# # (Optional) Treat warning level issues as fatal
# # (defaults to true).
# fatal-warnings: false
# # (Optional) Whether to add annotations to GitHub actions summary / PR
# # review files.
# # (defaults to true).
# annotate: true
# # (Optional) If set to true only annotations will be created and the
# # GitHub action itself will not fail on Dart analyzer problems.
# # (defaults to false).
# annotate-only: false
# # (Optional) The working directory to run the Dart analyzer in
# # (defaults to `./`).
# working-directory: ./