-
Notifications
You must be signed in to change notification settings - Fork 8
161 lines (160 loc) · 4.44 KB
/
pull-request.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Build and Test
on:
push:
pull_request:
defaults:
run:
shell: bash
env:
PUB_ENVIRONMENT: bot.github
# pinned to latest stable version
FLUTTER_SDK_VERSION: 3.19.3
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_SDK_VERSION }}
channel: "stable"
cache: true
- name: Install dependencies
run: flutter pub get
- name: Run tests
run: flutter test
- name: Cleanup
if: ${{ always() }}
run: |
if command -v flutter &>/dev/null; then
flutter clean
fi
build-android:
needs: test
name: Build Android flutter app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
cache: "gradle"
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_SDK_VERSION }}
channel: "stable"
cache: true
- name: Install example dependencies
working-directory: example
run: flutter pub get
- name: Test example
working-directory: example
run: flutter test
- name: Build example APK
working-directory: example
run: flutter build apk
- name: Check if example APK exists
working-directory: example
run: |
set -e
if [ ! -f build/app/outputs/apk/release/app-release.apk ]; then
echo "APK file not found!"
exit 1
fi
- name: Build example App Bundle
working-directory: example
run: flutter build appbundle
- name: Check if example App Bundle exists
working-directory: example
run: |
set -e
if [ ! -f build/app/outputs/bundle/release/app-release.aab ]; then
echo "App Bundle not found!"
exit 1
fi
- name: Cleanup
if: ${{ always() }}
working-directory: example
run: |
rm -rf build
if command -v flutter &>/dev/null; then
flutter clean
fi
build-ios:
needs: test
name: Build iOS flutter app
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_SDK_VERSION }}
channel: "stable"
cache: true
- name: Install example dependencies
working-directory: example
run: flutter pub get
- name: Test
working-directory: example
run: flutter test
- name: Build unsigned example Xcode archive
working-directory: example
run: flutter build ipa --no-codesign
- name: Check if unsigned example Xcode archive exists
working-directory: example
run: |
set -e
if [ ! -d build/ios/archive/Runner.xcarchive ]; then
echo "Xcode archive not found!"
exit 1
fi
- name: Cleanup
if: ${{ always() }}
working-directory: example
run: |
rm -rf build
if command -v flutter &>/dev/null; then
flutter clean
fi
build-web:
needs: test
name: Build web flutter app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_SDK_VERSION }}
channel: "stable"
cache: true
- name: Install example dependencies
working-directory: example
run: flutter pub get
- name: Test example
working-directory: example
run: flutter test
- name: Build example web
working-directory: example
run: flutter build web
- name: Check if example web exists
working-directory: example
run: |
set -e
if [ ! -f build/web/flutter.js ]; then
echo "Web build not found!"
exit 1
fi
- name: Cleanup
if: ${{ always() }}
working-directory: example
run: |
rm -rf build
if command -v flutter &>/dev/null; then
flutter clean
fi