-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (57 loc) · 1.96 KB
/
analysis.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
name: Analysis
on:
workflow_call:
inputs:
# (optional) you can specify which version of Flutter will be used, defaults is the latest release from stable channel
FLUTTER_VERSION:
required: false
type: string
jobs:
check_branch_content:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Content
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "LICENSE, README.md, example, CHANGELOG.md, CONTRIBUTING.md"
- name: File exists
if: steps.check_files.outputs.files_exists == 'true'
run: echo Content is ok!
- name: Check Description
run: echo | grep -q Description README.md ; echo $?
- name: Check Example
run: echo | grep -q Example README.md ; echo $?
- name: Check Installation
run: echo | grep -q Installation README.md ; echo $?
analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Flutter with exact version
if: ${{ inputs.FLUTTER_VERSION != ''}}
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ inputs.FLUTTER_VERSION }}
- name: Install Flutter from stable branch
if: ${{ inputs.FLUTTER_VERSION == ''}}
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Install dependencies
run: flutter pub get
- name: Run dependency validator
run: |
dart pub global activate dependency_validator
dart pub global run dependency_validator:dependency_validator
- name: Run analyzer
run: flutter analyze --fatal-warnings --fatal-infos .
- name: Run formatter
run: dart format --set-exit-if-changed .
- name: Run package analyzer
uses: axel-op/dart-package-analyzer@v3
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}