Skip to content

Commit 5bfdc43

Browse files
authored
Merge branch 'flutter' into alert_dialog
2 parents ce238fd + 26d912b commit 5bfdc43

File tree

8 files changed

+199
-82
lines changed

8 files changed

+199
-82
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "iPad Screenshots Workflow"
2+
3+
inputs:
4+
IPAD_DEVICE_MODEL:
5+
description: 'Model of the iPad device to be used when running tests'
6+
required: false
7+
default: iPad Pro 13-inch (M4)
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Set up Flutter
13+
uses: subosito/flutter-action@v2
14+
with:
15+
cache: true
16+
17+
- name: Update Podfile
18+
shell: bash
19+
run: |
20+
cd ./iOS
21+
flutter pub get
22+
pod install --repo-update
23+
24+
- name: Create iPad Simulator
25+
id: ipad_sim
26+
uses: futureware-tech/simulator-action@v4
27+
with:
28+
model: ${{ inputs.IPAD_DEVICE_MODEL }}
29+
wait_for_boot: true
30+
31+
- name: Capture iPad Screenshots
32+
shell: bash
33+
run: |
34+
DEVICE_NAME="${{ inputs.IPAD_DEVICE_MODEL }}" flutter drive --driver=test_integration/test_driver.dart --target=test_integration/screenshots.dart -d "${{ steps.ipad_sim.outputs.udid }}"
35+
36+
- name: Update Fastlane Metadata
37+
if: ${{ github.event_name == 'push' }}
38+
shell: bash
39+
run: |
40+
git config --global user.name "github-actions[bot]"
41+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
42+
43+
cd ./iOS
44+
git clone --branch=fastlane-ios --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} fastlane
45+
cd fastlane
46+
47+
rm -rf screenshots/*
48+
cp -r ../../screenshots/. screenshots/
49+
50+
# Force push to fastlane branch
51+
git checkout --orphan temporary
52+
git add --all .
53+
git commit -am "[Auto] Update screenshots ($(date +%Y-%m-%d.%H:%M:%S))"
54+
git branch -D fastlane-ios
55+
git branch -m fastlane-ios
56+
git push --force origin fastlane-ios
57+
58+
- name: Upload Screenshots
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: iPad Screenshots
62+
path: screenshots/*

.github/actions/screenshot-ios/action.yml renamed to .github/actions/screenshot-iphone/action.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
name: "iOS Screenshots Workflow"
1+
name: "iPhone Screenshots Workflow"
22

33
inputs:
44
IPHONE_DEVICE_MODEL:
55
description: 'Model of the iPhone device to be used when running tests'
66
required: false
77
default: iPhone 16 Pro Max
8-
IPAD_DEVICE_MODEL:
9-
description: 'Model of the iPad device to be used when running tests'
10-
required: false
11-
default: iPad Pro 13-inch (M4)
128

139
runs:
1410
using: "composite"
@@ -26,26 +22,16 @@ runs:
2622
pod install --repo-update
2723
2824
- name: Create iPhone Simulator
25+
id: iphone_sim
2926
uses: futureware-tech/simulator-action@v4
3027
with:
3128
model: ${{ inputs.IPHONE_DEVICE_MODEL }}
3229
wait_for_boot: true
3330

34-
- name: Create iPad Simulator
35-
uses: futureware-tech/simulator-action@v4
36-
with:
37-
model: ${{ inputs.IPAD_DEVICE_MODEL }}
38-
wait_for_boot: true
39-
4031
- name: Capture iPhone Screenshots
4132
shell: bash
4233
run: |
43-
DEVICE_NAME="${{ inputs.IPHONE_DEVICE_MODEL }}" flutter drive --driver=test_integration/test_driver.dart --target=test_integration/screenshots.dart -d "${{ inputs.IPHONE_DEVICE_MODEL }}"
44-
45-
- name: Capture iPad Screenshots
46-
shell: bash
47-
run: |
48-
DEVICE_NAME="${{ inputs.IPAD_DEVICE_MODEL }}" flutter drive --driver=test_integration/test_driver.dart --target=test_integration/screenshots.dart -d "${{ inputs.IPAD_DEVICE_MODEL }}"
34+
DEVICE_NAME="${{ inputs.IPHONE_DEVICE_MODEL }}" flutter drive --driver=test_integration/test_driver.dart --target=test_integration/screenshots.dart -d "${{ steps.iphone_sim.outputs.udid }}"
4935
5036
- name: Update Fastlane Metadata
5137
if: ${{ github.event_name == 'push' }}
@@ -72,5 +58,5 @@ runs:
7258
- name: Upload Screenshots
7359
uses: actions/upload-artifact@v4
7460
with:
75-
name: iOS Screenshots
61+
name: iPhone Screenshots
7662
path: screenshots/*

.github/workflows/pull-request-comment.yml

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,39 @@ jobs:
4747
4848
fs.writeFileSync('${{github.workspace}}/androidScreenshots.zip', Buffer.from(downloadAndroidScreenshots.data));
4949
50-
var iosScreenshots = artifacts.data.artifacts.filter((artifact) => {
51-
return artifact.name == "iOS Screenshots"
50+
var iPadScreenshots = artifacts.data.artifacts.filter((artifact) => {
51+
return artifact.name == "iPad Screenshots"
5252
})[0];
53-
var downloadIosScreenshots = await github.rest.actions.downloadArtifact({
53+
var downloadiPadScreenshots = await github.rest.actions.downloadArtifact({
5454
owner: context.repo.owner,
5555
repo: context.repo.repo,
56-
artifact_id: iosScreenshots.id,
56+
artifact_id: iPadScreenshots.id,
5757
archive_format: 'zip',
5858
});
5959
60-
fs.writeFileSync('${{github.workspace}}/iosScreenshots.zip', Buffer.from(downloadIosScreenshots.data));
60+
fs.writeFileSync('${{github.workspace}}/iPadScreenshots.zip', Buffer.from(downloadiPadScreenshots.data));
61+
62+
var iPhoneScreenshots = artifacts.data.artifacts.filter((artifact) => {
63+
return artifact.name == "iPhone Screenshots"
64+
})[0];
65+
var downloadiPhoneScreenshots = await github.rest.actions.downloadArtifact({
66+
owner: context.repo.owner,
67+
repo: context.repo.repo,
68+
artifact_id: iPhoneScreenshots.id,
69+
archive_format: 'zip',
70+
});
71+
72+
fs.writeFileSync('${{github.workspace}}/iPhoneScreenshots.zip', Buffer.from(downloadiPhoneScreenshots.data));
6173
6274
- name: Unzip Artifacts
6375
shell: bash
6476
run: |
6577
unzip pr.zip
6678
mkdir screenshots
6779
unzip androidScreenshots.zip -d screenshots/
68-
unzip iosScreenshots.zip -d screenshots/
69-
80+
unzip iPadScreenshots.zip -d screenshots/
81+
unzip iPhoneScreenshots.zip -d screenshots/
82+
7083
- name: Fetch PR Number
7184
id: fetch-pr-number
7285
uses: actions/github-script@v7
@@ -135,6 +148,8 @@ jobs:
135148
var statusText = `Build successful. APKs to test: ${artifact_url}.`;
136149
137150
var androidScreenshots = `
151+
<details>
152+
<summary>Android Screenshots</summary>
138153
<table>
139154
<tr>
140155
<td><img src="https://github.com/${owner}/${repo}/blob/pr-screenshots/${issue_number}_Pixel_6-1_instruments_screen.png?raw=true" width="1080"/></td>
@@ -150,9 +165,12 @@ jobs:
150165
</td>
151166
</tr>
152167
</table>
168+
</details>
153169
`;
154170
155171
var iPhoneScreenshots = `
172+
<details>
173+
<summary>iPhone Screenshots</summary>
156174
<table>
157175
<tr>
158176
<td><img src="https://github.com/${owner}/${repo}/blob/pr-screenshots/${issue_number}_iPhone_16_Pro_Max-1_instruments_screen.png?raw=true" width="1080"/></td>
@@ -168,9 +186,12 @@ jobs:
168186
</td>
169187
</tr>
170188
</table>
189+
</details>
171190
`;
172191
173192
var iPadScreenshots = `
193+
<details>
194+
<summary>iPad Screenshots</summary>
174195
<table>
175196
<tr>
176197
<td><img src="https://github.com/${owner}/${repo}/blob/pr-screenshots/${issue_number}_iPad_Pro_13-inch_(M4)-1_instruments_screen.png?raw=true" width="1080"/></td>
@@ -186,19 +207,16 @@ jobs:
186207
</td>
187208
</tr>
188209
</table>
210+
</details>
189211
`;
190212
191213
const body = `
192214
## Build Status
193215
${statusText}
194216
195-
## Screenshots (Android)
217+
## Screenshots
196218
${androidScreenshots}
197-
198-
## Screenshots (iPhone)
199219
${iPhoneScreenshots}
200-
201-
## Screenshots (iPad)
202220
${iPadScreenshots}
203221
`;
204222
@@ -245,13 +263,7 @@ jobs:
245263
## Build Status
246264
_Build workflow failed. Please check the logs for more information._
247265
248-
## Screenshots (Android)
249-
_Not able to fetch screenshots._
250-
251-
## Screenshots (iPhone)
252-
_Not able to fetch screenshots._
253-
254-
## Screenshots (iPad)
266+
## Screenshots
255267
_Not able to fetch screenshots._
256268
`;
257269

.github/workflows/pull-request.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ on:
44
pull_request:
55
branches: ["flutter"]
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
711
env:
812
ANDROID_EMULATOR_API: 34
913
ANDROID_EMULATOR_ARCH: x86_64
10-
IPHONE_DEVICE_MODEL: iPhone 16
11-
IPAD_DEVICE_MODEL: iPad (10th generation)
14+
IPHONE_DEVICE_MODEL: iPhone 16 Pro Max
15+
IPAD_DEVICE_MODEL: iPad Pro 13-inch (M4)
1216

1317
jobs:
1418
common:
@@ -58,6 +62,7 @@ jobs:
5862
screenshots-android:
5963
name: Screenshots (Android)
6064
runs-on: ubuntu-latest
65+
timeout-minutes: 60
6166
steps:
6267
- uses: actions/checkout@v4
6368

@@ -67,9 +72,10 @@ jobs:
6772
ANDROID_EMULATOR_API: ${{ env.ANDROID_EMULATOR_API }}
6873
ANDROID_EMULATOR_ARCH: ${{ env.ANDROID_EMULATOR_ARCH }}
6974

70-
screenshots-ios:
71-
name: Screenshots (iOS)
75+
screenshots-iphone:
76+
name: Screenshots (iPhone)
7277
runs-on: macos-latest
78+
timeout-minutes: 30
7379
steps:
7480
- name: Set up Xcode
7581
uses: maxim-lobanov/[email protected]
@@ -78,11 +84,24 @@ jobs:
7884

7985
- uses: actions/checkout@v4
8086

81-
- name: List available simulators
82-
run: xcrun simctl list devices
83-
84-
- name: iOS Screenshot Workflow
85-
uses: ./.github/actions/screenshot-ios
87+
- name: iPhone Screenshot Workflow
88+
uses: ./.github/actions/screenshot-iphone
8689
with:
8790
IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }}
91+
92+
screenshots-ipad:
93+
name: Screenshots (iPad)
94+
runs-on: macos-latest
95+
timeout-minutes: 30
96+
steps:
97+
- name: Set up Xcode
98+
uses: maxim-lobanov/[email protected]
99+
with:
100+
xcode-version: latest-stable
101+
102+
- uses: actions/checkout@v4
103+
104+
- name: iPad Screenshot Workflow
105+
uses: ./.github/actions/screenshot-ipad
106+
with:
88107
IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }}

.github/workflows/push-event.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
env:
88
ANDROID_EMULATOR_API: 34
99
ANDROID_EMULATOR_ARCH: x86_64
10-
IPHONE_DEVICE_MODEL: iPhone 16
11-
IPAD_DEVICE_MODEL: iPad (10th generation)
10+
IPHONE_DEVICE_MODEL: iPhone 16 Pro Max
11+
IPAD_DEVICE_MODEL: iPad Pro 13-inch (M4)
1212

1313
jobs:
1414
common:
@@ -202,31 +202,36 @@ jobs:
202202
with:
203203
version: ${{ needs.common.outputs.VERSION_NAME }}
204204

205-
screenshots-android:
206-
name: Screenshots (Android)
207-
runs-on: ubuntu-latest
205+
screenshots-iphone:
206+
name: Screenshots (iPhone)
207+
runs-on: macos-latest
208+
timeout-minutes: 30
208209
steps:
210+
- name: Set up Xcode
211+
uses: maxim-lobanov/[email protected]
212+
with:
213+
xcode-version: latest-stable
214+
209215
- uses: actions/checkout@v4
210216

211-
- name: Android Screenshot Workflow
212-
uses: ./.github/actions/screenshot-android
217+
- name: iPhone Screenshot Workflow
218+
uses: ./.github/actions/screenshot-iphone
213219
with:
214-
ANDROID_EMULATOR_API: ${{ env.ANDROID_EMULATOR_API }}
215-
ANDROID_EMULATOR_ARCH: ${{ env.ANDROID_EMULATOR_ARCH }}
216-
217-
screenshots-ios:
218-
name: Screenshots (iOS)
220+
IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }}
221+
222+
screenshots-ipad:
223+
name: Screenshots (iPad)
219224
runs-on: macos-latest
225+
timeout-minutes: 30
220226
steps:
221-
- uses: actions/checkout@v4
222-
223227
- name: Set up Xcode
224228
uses: maxim-lobanov/[email protected]
225229
with:
226230
xcode-version: latest-stable
227231

228-
- name: iOS Screenshot Workflow
229-
uses: ./.github/actions/screenshot-ios
232+
- uses: actions/checkout@v4
233+
234+
- name: iPad Screenshot Workflow
235+
uses: ./.github/actions/screenshot-ipad
230236
with:
231-
IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }}
232237
IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }}

0 commit comments

Comments
 (0)