-
Notifications
You must be signed in to change notification settings - Fork 266
79 lines (77 loc) · 2.67 KB
/
pr-healthchecks.yml
File metadata and controls
79 lines (77 loc) · 2.67 KB
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
name: Test
on:
pull_request:
# Due to a flutter bug, flutter build is not generating localizations
# workaround by always running flutter pub get immediately before building,
# and performing build for msix:create manually to allow implementing this workaround
jobs:
check-formatting:
name: Ensure correct formatting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build libgtk-3-dev
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Verify Flutter setup
run: flutter doctor
- name: Get dependencies
run: flutter pub get
- name: Verify code formatting
run: |
# Format locally generated localization files to prevent false positives
dart format lib/l10n/
dart format --output=none --set-exit-if-changed lib/
check-codegen:
name: Ensure correct code generation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build libgtk-3-dev
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Verify Flutter setup
run: flutter doctor
- name: Get dependencies
run: flutter pub get
- name: Verify code generation
run: |
dart run build_runner build --delete-conflicting-outputs
git add . # new files are not tracked by git
if git diff --cached --name-only | grep -q '\.g\.dart$'; then
echo "Code generation is different, diff follows"
git diff --cached | cat
exit 2
fi
- name: Verify splash screen generation
run: |
git reset HEAD -- . # clear any staged changes from previous steps
dart run flutter_native_splash:create --path=flutter_native_splash.yaml
git add .
if git diff --cached --name-only | grep -v pubspec.lock | grep -q .; then
echo "Splash screen generation is different, diff follows"
git diff --cached | cat
exit 2
fi