Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
06476ef
[WIP] Try migrating screenshots github action to buildkite.
jaclync Jun 25, 2025
2caeee9
[WIP] Only run screenshots commands in CI for testing.
jaclync Jun 25, 2025
9b2e082
[WIP] Try fixing `fatal: Failed to upload and process pipeline: Pipel…
jaclync Jun 25, 2025
afd89c0
[WIP] Try fixing canceled `take-screenshots` tasks.
jaclync Jun 25, 2025
7816c79
[WIP] Try fixing error `buildkite-agent: fatal: failed to download ar…
jaclync Jun 25, 2025
f719660
[WIP] Try caching build-screenshots to avoid unnecessary 8m execution…
jaclync Jun 25, 2025
4038f98
[WIP] Try fixing download artifacts issue again.
jaclync Jun 25, 2025
444a6e1
[WIP] Try fixing error `Running plugin cache post-checkout hook
jaclync Jun 25, 2025
a4f18d0
[WIP] Try fixing cache again.
jaclync Jun 25, 2025
d9674d6
[WIP] Try fixing `Uploading artifacts` error.
jaclync Jun 25, 2025
dd81581
[WIP] Another attempt.
jaclync Jun 25, 2025
ebc89b3
[WIP] Try fixing `tar: could not chdir to 'fastlane/DerivedData/Build…
jaclync Jun 25, 2025
9f6eb2e
[WIP] Try fixing `./.buildkite/commands/take-screenshots.sh: line 18:…
jaclync Jun 25, 2025
52aa932
[WIP] Try fixing `Testing failed:
jaclync Jun 25, 2025
040dd35
[WIP] Try fixing `./.buildkite/commands/take-screenshots.sh: line 32:…
jaclync Jun 25, 2025
b1a0451
[WIP] Try fixing env variables not set again.
jaclync Jun 26, 2025
83acffe
Use Buildkite artifacts instead of S3 since we don't know the credent…
jaclync Jun 26, 2025
91cbef9
Remove custom font download and installation as it should be availabl…
jaclync Jun 26, 2025
3408a99
Remove S3 variables in pipeline.
jaclync Jun 26, 2025
97d7b69
Try fixing GHA Xcode version error by running on macOS 15 image.
jaclync Jun 26, 2025
ad1db4f
Fix `The following step dependencies were not found during the build:…
jaclync Jun 26, 2025
d34e8b1
GHA: try fixing `WooCommerceScreenshots-Runner (19200) encountered an…
jaclync Jun 26, 2025
b733d22
Buildkite: try fixing `LFS not enabled – unable to generate promo scr…
jaclync Jun 26, 2025
2d980bc
Buildkite: temporarily remove PR label requirement.
jaclync Jun 26, 2025
79a93a2
Buildkite: try fixing remaining LFS issue.
jaclync Jun 26, 2025
3e30316
Buildkite: try fixing errors in process-screenshots.
jaclync Jun 26, 2025
9768ce0
GHA: try replacing AWS S3 storage with artifacts until we have more i…
jaclync Jun 26, 2025
9eed136
Buildkite: try fixing errors in process-screenshots.
jaclync Jun 26, 2025
c941377
GHA: try fixing `AztecEditor-iOS` syntax error guessing that it's fro…
jaclync Jun 26, 2025
495d3ca
Fix missing `drawText` for both GHA and Buildkite.
jaclync Jun 26, 2025
9ea46a5
Try fixing missing Proxima Nova font by falling back to other system …
jaclync Jun 26, 2025
14c7a7c
Still getting font not available error without falling back to other …
jaclync Jun 26, 2025
d7d8a5f
GHA: enable light mode for promo screenshots.
jaclync Jun 26, 2025
c7b8073
Buildkite: enable light mode for promo screenshots.
jaclync Jun 26, 2025
ab3944a
Revert Buildkite changes now that GHA is working (without the custom …
jaclync Jun 26, 2025
df09ae6
[WIP] Disable pipelines for now to save CI resources.
jaclync Jun 26, 2025
aca0843
Enable one more locale ineligible for POS tab.
jaclync Jun 26, 2025
dfa74a8
Just specify one font name since the fallback did not work with the `…
jaclync Jun 27, 2025
580a40f
Remove Proxima Nova font now that we are using Helvetica Neue that is…
jaclync Jun 27, 2025
f90287c
Re-enable all locales to measure the time and ensure promo screenshot…
jaclync Jun 27, 2025
602c99c
Try fixing `ar` issue by matching IOS_LOCALES in Fastfile.
jaclync Jun 27, 2025
01278a7
Merge branch 'trunk' into feat/WOOMOB-687-fix-ios-screenshots-gen-ci
jaclync Jun 27, 2025
172b470
Uncomment tasks pipeline steps.
jaclync Jun 27, 2025
5112f63
Merge branch 'trunk' into feat/WOOMOB-687-fix-ios-screenshots-gen-ci
jaclync Jul 18, 2025
6f118d2
Try addressing suggestion to remove the `Install Screenshot Gems` ste…
jaclync Jul 18, 2025
f02111c
Make build files discardable after 1 day as they are only used for th…
jaclync Jul 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 38 additions & 53 deletions .github/workflows/screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ on:
types: [opened, synchronize, reopened, labeled, unlabeled]

env:
S3_BUCKET: ${{ secrets.S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in 6f118d2, I hope this is what you meant. I triggered the screenshots generation workflow to verify that it works.

- name: "Check out Project"
Expand All @@ -30,26 +27,21 @@ jobs:
- name: Compile the App
run: bundle exec fastlane build_screenshots

- name: Archive App
- name: Archive Build Products
uses: actions/upload-artifact@v4
with:
name: screenshot-app
path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerce.app

- name: Archive Runner
uses: actions/upload-artifact@v4
with:
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 Author

Choose a reason for hiding this comment

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

Good idea, updated in f02111c.

retention-days: 1

capture:
name: Capture
needs: build
runs-on: macos-latest
runs-on: macos-15

strategy:
matrix:
language: [ar, de-DE, en-US, es-ES, fr-FR, he, id, it, ja, ko, nl-NL, pt-BR, ru, sv, tr, zh-Hans, zh-Hant]
language: [ar-SA, de-DE, en-US, es-ES, fr-FR, he, id, it, ja, ko, nl-NL, pt-BR, ru, sv, tr, zh-Hans, zh-Hant]
mode: [dark, light]
steps:
- uses: actions/checkout@v4
Expand All @@ -61,17 +53,11 @@ jobs:
- name: Install Fastlane Dependencies
run: bundle exec fastlane run configure_apply

- name: Download Screenshot App
uses: actions/download-artifact@v4
with:
name: screenshot-app
path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerce.app

- name: Download Screenshot Runner
- name: Download Build Products
uses: actions/download-artifact@v4
with:
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.


- name: Generate Screenshots
run: |
Expand All @@ -85,14 +71,18 @@ jobs:
path: fastlane/logs

- name: Archive Generated Screenshots
run: |
cd fastlane && mkdir $GITHUB_RUN_ID && mv screenshots $GITHUB_RUN_ID
aws s3 cp $GITHUB_RUN_ID s3://$S3_BUCKET/$GITHUB_RUN_ID --recursive --exclude "*.html"
uses: actions/upload-artifact@v4
with:
name: "screenshots-${{ matrix.language }}-${{ matrix.mode }}"
path: fastlane/screenshots/

process:
name: "Process Screenshots"
needs: capture
runs-on: macos-latest
runs-on: macos-15

env:
BUNDLE_WITH: screenshots

steps:
- uses: actions/checkout@v4
Expand All @@ -101,55 +91,50 @@ jobs:
run: |
brew install imagemagick@7
brew link imagemagick@7 --force
brew install automattic/build-tools/drawText

- name: "Set up Ruby"
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Install Screenshot Gems
run: bundle install --with screenshots

- name: Install Fastlane Dependencies
run: bundle exec fastlane run configure_apply

- name: Download Generated Screenshots
run: |
cd fastlane
aws s3 cp s3://$S3_BUCKET/$GITHUB_RUN_ID/screenshots screenshots/ --recursive --exclude "*.html"
uses: actions/download-artifact@v4
with:
pattern: "screenshots-*"
path: fastlane/screenshots/
merge-multiple: true

- name: Generate and Upload Screenshot Summary
- name: Generate Screenshot Summary
run: |
bundle exec fastlane create_screenshot_summary
aws s3 cp fastlane/screenshots/screenshots.html s3://$S3_BUCKET/$GITHUB_RUN_ID/screenshots/screenshots.html

- name: Upload Screenshot Summary
uses: actions/upload-artifact@v4
with:
name: screenshot-summary
path: fastlane/screenshots/screenshots.html

- name: Archive Raw Screenshots
uses: actions/upload-artifact@v4
with:
name: raw-screenshots
path: fastlane/screenshots

- name: Install Promo Screenshot Fonts
- name: Setup Git LFS
run: |
aws s3 cp s3://$S3_BUCKET/fonts.zip fonts.zip
unzip fonts.zip

mkdir -p ~/Library/Fonts
cp -v fonts/*.otf ~/Library/Fonts
ls ~/Library/Fonts

mkdir -p /Library/Fonts
cp -v fonts/*.otf /Library/Fonts
ls /Library/Fonts

# Reset the font server in order to use these fonts
atsutil databases -removeUser
atsutil server -shutdown
atsutil server -ping
# Install Git LFS if not available
if ! command -v git-lfs &> /dev/null; then
echo "Installing Git LFS..."
brew install git-lfs
fi
git lfs install && git lfs fetch && git lfs pull

- name: Generate Promo Screenshots
run: |
git lfs install && git lfs fetch && git lfs pull
bundle exec fastlane create_promo_screenshots force:true

- name: Archive Promo Screenshots
Expand Down
2 changes: 2 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,8 @@ platform :ios do

desc 'Create Screenshot Summary'
lane :create_screenshot_summary do
# Ensure we're using the right version of Xcode, defined in `.xcode-version` file
xcversion
fastlane_require 'snapshot'

# Provide enough information to bootstrap the configuration and generate the HTML report
Expand Down
4 changes: 2 additions & 2 deletions fastlane/appstoreres/assets/styles/style.css
Git LFS file not shown
Loading