Skip to content

Commit b42d16d

Browse files
Merge branch 'development' into streaming_feature
2 parents 9a7b4b3 + e230935 commit b42d16d

File tree

23 files changed

+650
-415
lines changed

23 files changed

+650
-415
lines changed

.github/actions/android/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ runs:
2626
using: "composite"
2727
steps:
2828
- name: Set up Java
29-
uses: actions/setup-java@v4
29+
uses: actions/setup-java@v5
3030
with:
3131
java-version: 17
3232
distribution: 'adopt'

.github/actions/screenshot-android/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ runs:
1414
using: "composite"
1515
steps:
1616
- name: Set up Java
17-
uses: actions/setup-java@v4
17+
uses: actions/setup-java@v5
1818
with:
1919
java-version: 17
2020
distribution: 'adopt'
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
flutter-version-file: pubspec.yaml
17+
18+
- name: Update Podfile
19+
shell: bash
20+
run: |
21+
cd ./iOS
22+
flutter pub get
23+
pod install --repo-update
24+
25+
- name: Create iPad Simulator
26+
id: ipad_sim
27+
uses: futureware-tech/simulator-action@v4
28+
with:
29+
model: ${{ inputs.IPAD_DEVICE_MODEL }}
30+
wait_for_boot: true
31+
32+
- name: Capture iPad Screenshots
33+
shell: bash
34+
run: |
35+
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 }}"
36+
37+
- name: Update Fastlane Metadata
38+
if: ${{ github.event_name == 'push' }}
39+
shell: bash
40+
run: |
41+
git config --global user.name "github-actions[bot]"
42+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
43+
44+
cd ./iOS
45+
git clone --branch=fastlane-ios --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} fastlane
46+
cd fastlane
47+
48+
rm -rf screenshots/iPad*
49+
cp -r ../../screenshots/. screenshots/
50+
51+
# Force push to fastlane branch
52+
git checkout --orphan temporary
53+
git add --all .
54+
git commit -am "[Auto] Update screenshots ($(date +%Y-%m-%d.%H:%M:%S))"
55+
git branch -D fastlane-ios
56+
git branch -m fastlane-ios
57+
git push --force origin fastlane-ios
58+
59+
- name: Upload Screenshots
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: iPad Screenshots
63+
path: screenshots/*

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

Lines changed: 5 additions & 19 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"
@@ -27,26 +23,16 @@ runs:
2723
pod install --repo-update
2824
2925
- name: Create iPhone Simulator
26+
id: iphone_sim
3027
uses: futureware-tech/simulator-action@v4
3128
with:
3229
model: ${{ inputs.IPHONE_DEVICE_MODEL }}
3330
wait_for_boot: true
3431

35-
- name: Create iPad Simulator
36-
uses: futureware-tech/simulator-action@v4
37-
with:
38-
model: ${{ inputs.IPAD_DEVICE_MODEL }}
39-
wait_for_boot: true
40-
4132
- name: Capture iPhone Screenshots
4233
shell: bash
4334
run: |
44-
DEVICE_NAME="${{ inputs.IPHONE_DEVICE_MODEL }}" flutter drive --driver=test_integration/test_driver.dart --target=test_integration/screenshots.dart -d "${{ inputs.IPHONE_DEVICE_MODEL }}"
45-
46-
- name: Capture iPad Screenshots
47-
shell: bash
48-
run: |
49-
DEVICE_NAME="${{ inputs.IPAD_DEVICE_MODEL }}" flutter drive --driver=test_integration/test_driver.dart --target=test_integration/screenshots.dart -d "${{ inputs.IPAD_DEVICE_MODEL }}"
35+
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 }}"
5036
5137
- name: Update Fastlane Metadata
5238
if: ${{ github.event_name == 'push' }}
@@ -59,7 +45,7 @@ runs:
5945
git clone --branch=fastlane-ios --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} fastlane
6046
cd fastlane
6147
62-
rm -rf screenshots/*
48+
rm -rf screenshots/iPhone*
6349
cp -r ../../screenshots/. screenshots/
6450
6551
# Force push to fastlane branch
@@ -73,5 +59,5 @@ runs:
7359
- name: Upload Screenshots
7460
uses: actions/upload-artifact@v4
7561
with:
76-
name: iOS Screenshots
62+
name: iPhone Screenshots
7763
path: screenshots/*

.github/workflows/clean_screenshots.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout repository
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v5
1717
with:
1818
ref: pr-screenshots
1919

.github/workflows/devcontainer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
permissions:
1212
packages: write
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
1515

1616
- name: Lowercase repository owner
1717
run: echo "REPO_OWNER_LOWER=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}

.github/workflows/flutter_upgrade.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
steps:
1313
- name: Checkout repository
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

1616
- name: Read Flutter version from pubspec.yaml
1717
id: read-version

.github/workflows/pull_request.yml

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ on:
44
pull_request:
55
branches: [ "development" ]
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:
1519
name: Common Build
1620
runs-on: ubuntu-latest
1721
steps:
18-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
1923

2024
- name: Common Workflow
2125
uses: ./.github/actions/common
@@ -35,7 +39,7 @@ jobs:
3539
needs: common
3640
runs-on: ubuntu-latest
3741
steps:
38-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@v5
3943

4044
- name: Android Workflow
4145
uses: ./.github/actions/android
@@ -48,42 +52,57 @@ jobs:
4852
- name: Set up Xcode
4953
uses: maxim-lobanov/[email protected]
5054
with:
51-
xcode-version: 16.4.0
55+
xcode-version: latest-stable
5256

53-
- uses: actions/checkout@v4
57+
- uses: actions/checkout@v5
5458

5559
- name: iOS Workflow
5660
uses: ./.github/actions/ios
5761

5862
screenshots-android:
5963
name: Screenshots (Android)
6064
runs-on: ubuntu-latest
65+
timeout-minutes: 30
6166
steps:
62-
- uses: actions/checkout@v4
67+
- uses: actions/checkout@v5
6368

6469
- name: Android Screenshot Workflow
6570
uses: ./.github/actions/screenshot-android
6671
with:
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]
7682
with:
77-
xcode-version: 16.4.0
78-
79-
- uses: actions/checkout@v4
83+
xcode-version: latest-stable
8084

81-
- name: List available simulators
82-
run: xcrun simctl list devices
85+
- uses: actions/checkout@v5
8386

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@v5
103+
104+
- name: iPad Screenshot Workflow
105+
uses: ./.github/actions/screenshot-ipad
106+
with:
88107
IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }}
89108

.github/workflows/pull_request_comment.yml

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,38 @@ 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/
80+
unzip iPadScreenshots.zip -d screenshots/
81+
unzip iPhoneScreenshots.zip -d screenshots/
6982
7083
- name: Fetch PR Number
7184
id: fetch-pr-number
@@ -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/fossasia/badgemagic-app/blob/pr-screenshots/${issue_number}_Pixel_6-1_home_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/fossasia/badgemagic-app/blob/pr-screenshots/${issue_number}_iPhone_16_Pro_Max-1_home_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/fossasia/badgemagic-app/blob/pr-screenshots/${issue_number}_iPad_Pro_13-inch_(M4)-1_home_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

0 commit comments

Comments
 (0)