-
Notifications
You must be signed in to change notification settings - Fork 285
218 lines (181 loc) · 6.4 KB
/
Copy pathpull_request.yml
File metadata and controls
218 lines (181 loc) · 6.4 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
211
212
213
214
215
216
217
218
name: Badge Magic PR CI
on:
pull_request:
branches: [ "development" ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ANDROID_EMULATOR_API: 34
ANDROID_EMULATOR_ARCH: x86_64
IPHONE_DEVICE_MODEL: iPhone 16 Pro Max
IPAD_DEVICE_MODEL: iPad Pro 13-inch (M4)
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
is_code: ${{ steps.check.outputs.is_code }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- id: check
run: |
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -vE '\.(md|png|jpg|jpeg|gif|svg|webp|txt)$' | grep -v '^docs/'; then
echo "is_code=true" >> $GITHUB_OUTPUT
else
echo "is_code=false" >> $GITHUB_OUTPUT
fi
common:
name: Common Build
needs: changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
if: needs.changes.outputs.is_code == 'true'
- name: Common Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/common
- name: Save PR number
if: needs.changes.outputs.is_code == 'true'
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v6
if: needs.changes.outputs.is_code == 'true'
with:
name: pr
path: pr/
- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."
android:
name: Android Flutter Build
needs: [changes, common]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
if: needs.changes.outputs.is_code == 'true'
- name: Android Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/android
- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."
ios:
name: iOS Flutter Build
needs: [changes, common]
runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }}
steps:
- name: Set up Xcode
if: needs.changes.outputs.is_code == 'true'
uses: maxim-lobanov/setup-xcode@v1.7.0
with:
xcode-version: latest-stable
- uses: actions/checkout@v5
if: needs.changes.outputs.is_code == 'true'
- name: iOS Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/ios
- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."
screenshots-android:
name: Screenshots (Android)
needs: [changes, common]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
if: needs.changes.outputs.is_code == 'true'
- name: Android Screenshot Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/screenshot-android
with:
ANDROID_EMULATOR_API: ${{ env.ANDROID_EMULATOR_API }}
ANDROID_EMULATOR_ARCH: ${{ env.ANDROID_EMULATOR_ARCH }}
- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."
screenshots-iphone:
name: Screenshots (iPhone)
needs: [changes, common]
runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }}
timeout-minutes: 30
steps:
- name: Set up Xcode
if: needs.changes.outputs.is_code == 'true'
uses: maxim-lobanov/setup-xcode@v1.7.0
with:
xcode-version: latest-stable
- uses: actions/checkout@v5
if: needs.changes.outputs.is_code == 'true'
- name: iPhone Screenshot Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/screenshot-iphone
with:
IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }}
- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."
screenshots-ipad:
name: Screenshots (iPad)
needs: [changes, common]
runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }}
timeout-minutes: 30
steps:
- name: Set up Xcode
if: needs.changes.outputs.is_code == 'true'
uses: maxim-lobanov/setup-xcode@v1.7.0
with:
xcode-version: latest-stable
- uses: actions/checkout@v5
if: needs.changes.outputs.is_code == 'true'
- name: iPad Screenshot Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/screenshot-ipad
with:
IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }}
- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."
macos:
name: macOS Flutter Build
needs: [changes, common]
runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'macos-latest' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v5
if: needs.changes.outputs.is_code == 'true'
- name: macOS Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/macos
- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."
windows:
name: Windows Flutter Build
needs: [changes, common]
runs-on: ${{ needs.changes.outputs.is_code == 'true' && 'windows-latest' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v5
if: needs.changes.outputs.is_code == 'true'
- name: Windows Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/windows
- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."
debian:
name: Debian Flutter Build
needs: [changes, common]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
if: needs.changes.outputs.is_code == 'true'
- name: Debian Workflow
if: needs.changes.outputs.is_code == 'true'
uses: ./.github/actions/debian
- name: Non-Code Change
if: needs.changes.outputs.is_code != 'true'
run: echo "Non-code change detected."