-
Notifications
You must be signed in to change notification settings - Fork 25
98 lines (81 loc) · 2.55 KB
/
flutter-app-code-check.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
88
89
90
91
92
93
94
95
96
97
98
name: Flutter app code check
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
flutter: ${{ steps.filter.outputs.flutter }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Filter by paths
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
flutter:
- '**/android/**'
- '**/assets/**'
- '**/dart_defines/**'
- '**/golden_test/**'
- '**/ios/**'
- '**/lib/**'
- '**/test/**'
- '**/web/**'
- '**/analysis_options.yaml'
- '**/melos.yaml'
- '**/pubspec.yaml'
- '.fvmrc'
analyze:
needs: check
if: ${{ needs.check.outputs.flutter == 'true' && github.event_name != 'push' }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter with FVM
id: setup-flutter
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
- name: Prepare Melos
run: echo "MELOS_SDK_PATH=${{ env.FLUTTER_ROOT }}" >> "$GITHUB_ENV"
- name: Install Melos
uses: bluefireteam/melos-action@v3
- name: Analyze packages
run: melos analyze --fatal-infos
- name: Run custom lint
run: melos run custom_lint
- name: Check for the existence of unformatted files
# Cannot use `melos format` as it requires excluding files generated from the target file
run: melos run format:ci --no-select
test:
needs: check
if: needs.check.outputs.flutter == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter with FVM
id: setup-flutter
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
- name: Prepare Melos
run: echo "MELOS_SDK_PATH=${{ env.FLUTTER_ROOT }}" >> "$GITHUB_ENV"
- name: Install Melos
uses: bluefireteam/melos-action@v3
- name: Run package tests
run: melos run test:ci --no-select
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info