forked from yumemi-inc/flutter-engineer-codecheck
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (59 loc) · 1.79 KB
/
analyze-and-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
name: Analyze and Test
on:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: beta
cache: true
- name: Cache build_runner
uses: actions/cache@v2
with:
path: '**/.dart_tool/build'
key: build-runner-${{ hashFiles('**/asset_graph.json') }}-${{ hashFiles('**/pubspec.lock') }}
restore-keys: build-runner-
- name: Get dependencies
run: flutter pub get
- name: Exec build_runner
run: dart pub run build_runner build
- name: Format
run: dart format --output=none --set-exit-if-changed .
- name: Analyze
run: flutter analyze
test:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: beta
cache: true
- name: Cache build_runner
uses: actions/cache@v2
with:
path: '**/.dart_tool/build'
key: build-runner-${{ hashFiles('**/asset_graph.json') }}-${{ hashFiles('**/pubspec.lock') }}
restore-keys: build-runner-
- name: Get dependencies
run: flutter pub get
- name: Exec build_runner
run: dart pub run build_runner build
- name: Run tests
run: flutter test --coverage
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
files: ./coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}