-
Notifications
You must be signed in to change notification settings - Fork 19
103 lines (82 loc) · 2.44 KB
/
ci.yml
File metadata and controls
103 lines (82 loc) · 2.44 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
flutter_path: /opt/hostedtoolcache/flutter
- os: macos-latest
flutter_path: /Users/runner/hostedtoolcache/flutter
- os: windows-latest
flutter_path: C:\hostedtoolcache\windows\flutter
steps:
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.27.0'
channel: 'stable'
- name: Install dependencies
run: flutter pub get
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .
- name: Analyze project source
run: flutter analyze
- name: Run tests
run: flutter test
- name: Check pub score
run: |
dart pub global activate pana
echo "Running pana analysis..."
dart pub global run pana --no-warning --exit-code-threshold 10
echo ""
echo "Note: permission_handler is constrained to ^11.3.1 by daily_flutter 0.31.0"
echo "This causes a 10-point deduction in the pub score."
example:
name: Build example app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.27.0'
channel: 'stable'
- name: Install dependencies (root)
run: flutter pub get
- name: Install dependencies (example)
run: |
cd example
flutter pub get
- name: Build Android APK
run: |
cd example
flutter build apk --debug
- name: Build iOS (simulator only)
if: matrix.os == 'macos-latest'
run: |
cd example
flutter build ios --debug --simulator
publish-dry-run:
name: Publish dry run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.27.0'
channel: 'stable'
- name: Install dependencies
run: flutter pub get
- name: Publish dry run
run: flutter pub publish --dry-run