-
Notifications
You must be signed in to change notification settings - Fork 3
65 lines (54 loc) · 1.61 KB
/
flutter-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
name: Dart Format and Analyze
on:
push:
branches: [develop, qa, prod]
pull_request:
branches: "**"
permissions:
pull-requests: write
contents: write
jobs:
format-and-analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.x"
channel: "stable"
- name: Configure Git
run: |
git fetch --prune
git checkout ${{github.head_ref}} --progress
git config --global user.name "Dark Relics Automatic"
git config --global user.email "[email protected]"
- name: Install dependencies
working-directory: registration
run: flutter pub get
- name: Verify formatting
working-directory: registration
run: dart format .
- name: Analyze project source
working-directory: registration
run: |
dart fix --apply
dart analyze
flutter analyze
- name: Check for changes
id: git-check
run: |
git add . -vv
if git diff-index --quiet HEAD; then
echo "changes=false" >> $GITHUB_OUTPUT
else
echo "changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.git-check.outputs.changes == 'true'
run: |
git pull --rebase origin ${{github.head_ref}}
git commit -m "Apply Flutter Autoformatting" -vv
git push -vv