Skip to content

[iOS Screenshots CI] Fix screenshots generation GitHub Action #15822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 43 commits into
base: trunk
Choose a base branch
from

Conversation

jaclync
Copy link
Contributor

@jaclync jaclync commented Jun 26, 2025

Closes WOOMOB-721

Why

The iOS screenshots generation CI job via the generate-screenshots GitHub label in a PR has been broken for a while since it was added in 2021. The team has been relying on manually generating the raw and promo screenshots and upload them to the App Store. This PR fixes the CI job which is a GitHub Action that public repos have unlimited access for free. We might still want to migrate to Buildkite for better performance in the future, but since this is a job required rather infrequently and without cost, the slow time (3h6m) and 403MB for just the promo screenshots for 17 locales are fine for now.

How

  • Replace S3 upload/download with GHA artifacts
  • Remove custom font download and use Helvetica Neue instead, since Proxima Nova doesn't seem to be available in CI macOS image even though it is supposed to be included in macOS Sonoma+

Known issue

When running the CI job with all locales, there were some flaky locales that didn't pass testScreenshots for the first time. I also noticed the last screenshot, showing a push notification, is missing the push notification for a subset of locales from the promo-screenshots artifact. For example, the it 5th screenshot in both tablet and phone does not have the notification. I hadn't seen this flakiness locally, and will look into this more separately in WOOMOB-722.

Test plan

  • Verify screenshot generation jobs upload artifacts correctly
  • Compare generated screenshots with the system font have little visual difference from App Store screenshots

Example screenshots

Feel free to download en-US screenshots here from GHA artifacts and compare them with the App Store screenshots.

locale App Store (Proxima Nova) CI generated (Helvetica Neue)
en-US 0x0ss iPad Pro 13-inch (M4)-01
en-US en-us-2 iPad Pro 13-inch (M4)-02
ar-SA ar iPad Pro 13-inch (M4)-04
locale App Store (Proxima Nova) CI generated (Helvetica Neue)
es-ES
ja

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

jaclync added 18 commits June 26, 2025 09:48
…ine upload rejected: `step` may only contain alphanumeric characters, slashes, dashes or underscores`.
…tifacts: GET ...: 400 Bad Request: Multiple artifacts were found for query: `screenshot-artifacts.tar`. Try scoping by the job ID or name.`.
🚨 Missing path option in the cache plugin to restore
🚨 Error: running "plugin cache post-checkout" shell hook: The plugin cache post-checkout hook exited with status 1`.
	WooCommerceScreenshots-Runner (3506) encountered an error (Failed to load the test bundle. (Underlying Error: The bundle “WooCommerceScreenshots” couldn’t be loaded. The bundle couldn’t be loaded. Try reinstalling the bundle.`.
@jaclync jaclync force-pushed the feat/WOOMOB-687-fix-ios-screenshots-gen-ci branch from 9b6b3c5 to 91cbef9 Compare June 26, 2025 13:48
@jaclync jaclync added the generate screenshots Triggers a GitHub Action to generate screenshots for this PR. label Jun 26, 2025
jaclync added 5 commits June 26, 2025 09:54
… error (Failed to load the test bundle. (Underlying Error: The bundle “WooCommerceScreenshots” couldn’t be loaded` error.
…eenshots. Run `git lfs install && git lfs fetch && git lfs pull` to fix this.` error.
@jaclync jaclync added generate screenshots Triggers a GitHub Action to generate screenshots for this PR. and removed generate screenshots Triggers a GitHub Action to generate screenshots for this PR. labels Jun 26, 2025
@jaclync jaclync changed the title [iOS Screenshots CI] Replace S3 storage with Buildkite artifacts for screenshot workflow [iOS Screenshots CI] Fix screenshots generation GitHub Action Jun 26, 2025
@jaclync jaclync marked this pull request as draft June 26, 2025 21:04
Base automatically changed from feat/WOOMOB-673-generate-screenshots-for-pos-tab to trunk June 27, 2025 12:13
name: screenshot-runner
path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerceScreenshots-Runner.app
name: screenshot-build-products
path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ There are more files required for later steps than just the WooCommerce.app and WooCommerceScreenshots-Runner.app. Otherwise, errors like WooCommerceScreenshots-Runner (19200) encountered an error (Failed to load the test bundle. (Underlying Error: The bundle “WooCommerceScreenshots” couldn’t be loaded are thrown.

@jaclync jaclync removed the generate screenshots Triggers a GitHub Action to generate screenshots for this PR. label Jun 27, 2025
@wpmobilebot
Copy link
Collaborator

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Number30855
VersionPR #15822
Bundle IDcom.automattic.alpha.woocommerce
Commit172b470
Installation URL7c4pa6q9vkdr0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@jaclync jaclync marked this pull request as ready for review June 27, 2025 20:06
@jaclync jaclync requested a review from a team June 27, 2025 20:06
@jaclync jaclync added this to the 22.8 milestone Jun 27, 2025
@jaclync jaclync added the category: screenshots Related to generating screenshots for the App Store. label Jun 27, 2025
CONFIGURE_ENCRYPTION_KEY: ${{ secrets.CONFIGURE_ENCRYPTION_KEY }}

jobs:
build:
name: Build Application
if: contains(github.event.pull_request.labels.*.name, 'generate screenshots')
runs-on: macos-latest
runs-on: macos-15

steps:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not part of this PR, but an improvement idea:

we should be able to remove the Install Screenshot Gems step and use this env var at the job level instead (which will make the ruby/setup-ruby@v1 step to already use the screenshots group without a separate step).

env:
      BUNDLE_WITH: screenshots

name: screenshot-runner
path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerceScreenshots-Runner.app
name: screenshot-build-products
path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not worth it for the storage reclaim per se, but maybe worth it to make it clearer that these are discardable adding something like:

Suggested change
path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/
path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/
retention-days: 1

Copy link
Contributor

@iangmaia iangmaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on getting it up and working again! 👍
Approving to unblock; just added a couple of minor comments.

And I agree it's best to at some point migrate this to Buildkite and integrate it with the rest of the release automation.

@wpmobilebot wpmobilebot modified the milestones: 22.8, 22.9 Jul 11, 2025
@wpmobilebot
Copy link
Collaborator

Version 22.8 has now entered code-freeze, so the milestone of this PR has been updated to 22.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: screenshots Related to generating screenshots for the App Store.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants