-
-
Notifications
You must be signed in to change notification settings - Fork 10
210 lines (187 loc) · 6.04 KB
/
Copy pathflutter_example_ci.yaml
File metadata and controls
210 lines (187 loc) · 6.04 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
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: Flutter Example App CI
on:
workflow_dispatch:
push:
branches:
- main
- master
paths:
- "flutter/**"
- ".github/workflows/flutter_example_ci.yaml"
- "**.dart"
- "**.yaml"
- "**.yml"
- "**.gradle"
- "**.kt"
- "**.swift"
- "**.m"
- "**.h"
- "**.mm"
- "**.hpp"
- "**.c"
- "**.cpp"
- "**.cc"
- "**.podspec"
- "!**.md"
- "!flutter/doc/**"
pull_request:
paths:
- "flutter/**"
- ".github/workflows/flutter_example_ci.yaml"
- "**.dart"
- "**.yaml"
- "**.yml"
- "**.gradle"
- "**.kt"
- "**.swift"
- "**.m"
- "**.h"
- "**.mm"
- "**.podspec"
- "**.hpp"
- "**.c"
- "**.cpp"
- "**.cc"
- "!**.md"
- "!flutter/doc/**"
concurrency:
group: flutter-example-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build (${{ matrix.platform }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- platform: android
os: ubuntu-latest
artifact_name: app-debug.apk
build_command: flutter build apk --debug
- platform: ios
os: macos-latest
artifact_name: Runner.app
build_command: flutter build ios --debug --no-codesign
- platform: ios-simulator
os: macos-latest
artifact_name: Runner.app
build_command: flutter build ios --simulator --debug --no-codesign
- platform: windows
os: windows-latest
artifact_name: build\windows\x64\runner\Debug
build_command: flutter build windows --debug
- platform: linux
os: ubuntu-latest
artifact_name: build/linux/x64/debug/bundle
build_command: flutter build linux --debug
- platform: macos
os: macos-latest
artifact_name: build/macos/Build/Products/Debug
build_command: flutter build macos --debug
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Clone Flutter SDK
uses: subosito/flutter-action@v2
with:
flutter-version: "3.44.0"
channel: "stable"
cache: true
- name: Set path for WSL builds
if: matrix.platform == 'windows'
run: |
echo "$WINDIR\\System32" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Configure Android SDK
if: matrix.platform == 'android'
run: |
flutter config --no-analytics
yes | flutter doctor --android-licenses >/dev/null
- name: Configure Apple build
if: matrix.platform == 'ios' || matrix.platform == 'macos'
run: |
flutter config --no-analytics
flutter config --enable-swift-package-manager
sudo xcodebuild -license accept 2>/dev/null || true
- name: Configure Linux dependencies
if: matrix.platform == 'linux'
run: |
flutter config --no-analytics
sudo apt-get update -qq
sudo apt-get install -y -qq libgtk-3-dev pkg-config cmake ninja-build liblzma-dev libstdc++-12-dev
- name: Install bundle dependencies
working-directory: flutter/example
run: flutter pub get
- name: Get Flutter dependencies
working-directory: flutter/example
run: flutter pub get --offline || true
- name: Unlock keychain
if: matrix.platform == 'ios'
run: |
security default-keychain -s login.keychain
security unlock-keychain -p "$KEYCHAIN_PASSWORD" ~/Library/Keychains/login.keychain
security set-keychain-settings -lut 21600 ~/Library/Keychains/login.keychain
- name: Build ${{ matrix.platform }}
working-directory: flutter/example
run: ${{ matrix.build_command }}
- name: Upload artifacts
if: matrix.platform == 'android'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-app
path: flutter/example/build/app/outputs/flutter-apk/${{ matrix.artifact_name }}
retention-days: 7
- name: Upload artifacts (Windows)
if: matrix.platform == 'windows'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-app
path: flutter/example/${{ matrix.artifact_name }}
retention-days: 7
- name: Upload artifacts (Linux)
if: matrix.platform == 'linux'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-app
path: flutter/example/${{ matrix.artifact_name }}
retention-days: 7
- name: Upload artifacts (iOS)
if: matrix.platform == 'ios'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-app
path: flutter/example/build/ios/iphoneos/
retention-days: 7
- name: Upload artifacts (iOS Simulator)
if: matrix.platform == 'ios-simulator'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-app
path: flutter/example/build/ios/iphonesimulator/
retention-days: 7
- name: Upload artifacts (macOS)
if: matrix.platform == 'macos'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-app
path: flutter/example/${{ matrix.artifact_name }}
retention-days: 7
analyze:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Clone Flutter SDK
uses: subosito/flutter-action@v2
with:
flutter-version: "3.47.0"
channel: "stable"
cache: true
- name: Install dependencies
working-directory: flutter/example
run: flutter pub get
- name: Run Flutter analyze
working-directory: flutter/example
run: flutter analyze --no-fatal-infos