-
Notifications
You must be signed in to change notification settings - Fork 273
87 lines (70 loc) · 2.06 KB
/
ci.yml
File metadata and controls
87 lines (70 loc) · 2.06 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
name: Flutter CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "17"
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.x"
- run: flutter pub get
- name: Check formatting (excluding generated files)
shell: bash
run: |
set -euo pipefail
files=$(git ls-files '*.dart' | grep -Ev '^lib/types\.dart$|\.g\.dart$|\.freezed\.dart$' || true)
if [[ -z "$files" ]]; then
exit 0
fi
printf '%s\n' "$files" | xargs dart format --page-width 80 --output=none --set-exit-if-changed
- run: flutter analyze
- run: flutter test --coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: hyochan/flutter_inapp_purchase
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "17"
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.x"
- name: Create env file
run: touch example/env
- run: flutter pub get
working-directory: example
- name: Build Android APK
run: flutter build apk --debug
working-directory: example
build-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.x"
- name: Create env file
run: touch example/env
- run: flutter pub get
working-directory: example
- name: Build iOS (no codesign)
run: flutter build ios --no-codesign --debug
working-directory: example