From 06476ef4b7b8f43e060419e7a277394259ca2c93 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 16:35:12 -0400 Subject: [PATCH 01/44] [WIP] Try migrating screenshots github action to buildkite. --- .buildkite/commands/build-screenshots.sh | 27 +++++++ .buildkite/commands/process-screenshots.sh | 58 +++++++++++++++ .buildkite/commands/take-screenshots.sh | 32 ++++++++ .buildkite/screenshots-pipeline.yml | 87 ++++++++++++++++++++++ 4 files changed, 204 insertions(+) create mode 100755 .buildkite/commands/build-screenshots.sh create mode 100755 .buildkite/commands/process-screenshots.sh create mode 100755 .buildkite/commands/take-screenshots.sh create mode 100644 .buildkite/screenshots-pipeline.yml diff --git a/.buildkite/commands/build-screenshots.sh b/.buildkite/commands/build-screenshots.sh new file mode 100755 index 00000000000..febb0ba2a47 --- /dev/null +++ b/.buildkite/commands/build-screenshots.sh @@ -0,0 +1,27 @@ +#!/bin/bash -eu + +if .buildkite/commands/should-skip-job.sh --job-type build; then + exit 0 +fi + +echo "--- :rubygems: Setting up Gems" +install_gems + +echo "--- :swift: Setting up Swift Packages" +install_swiftpm_dependencies + +echo "--- :writing_hand: Copy Files" +mkdir -pv ~/.configure/woocommerce-ios/secrets +cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/project.env + +echo "--- :hammer_and_wrench: Building Screenshots App" +bundle exec fastlane build_screenshots + +echo "--- :arrow_up: Upload Screenshot App Artifacts" +# Create a structured archive of the built apps +tar -cf screenshot-artifacts.tar \ + -C fastlane/DerivedData/Build/Products/Debug-iphonesimulator \ + WooCommerce.app \ + WooCommerceScreenshots-Runner.app + +buildkite-agent artifact upload screenshot-artifacts.tar \ No newline at end of file diff --git a/.buildkite/commands/process-screenshots.sh b/.buildkite/commands/process-screenshots.sh new file mode 100755 index 00000000000..bbdb76d2357 --- /dev/null +++ b/.buildkite/commands/process-screenshots.sh @@ -0,0 +1,58 @@ +#!/bin/bash -eu + +echo "--- :rubygems: Setting up Gems" +install_gems + +echo "--- :apple: Install Native Dependencies" +# Install ImageMagick for screenshot processing +if ! command -v magick &> /dev/null; then + echo "Installing ImageMagick..." + brew install imagemagick@7 + brew link imagemagick@7 --force +fi + +echo "--- :gem: Install Screenshot Gems" +bundle install --with screenshots + +echo "--- :writing_hand: Copy Files" +mkdir -pv ~/.configure/woocommerce-ios/secrets +cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/project.env + +echo "--- :gear: Setup Fastlane Dependencies" +bundle exec fastlane run configure_apply + +echo "--- :arrow_down: Download Generated Screenshots from S3" +cd fastlane +mkdir -p screenshots +aws s3 cp "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID}/" screenshots/ --recursive --exclude "*.html" + +echo "--- :chart_with_upwards_trend: Generate Screenshot Summary" +bundle exec fastlane create_screenshot_summary +aws s3 cp screenshots/screenshots.html "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID}/screenshots/screenshots.html" + +echo "--- :arrow_down: Install Promo Screenshot Fonts" +cd .. +aws s3 cp "s3://${S3_BUCKET}/fonts.zip" fonts.zip +unzip fonts.zip + +# Install fonts system-wide and user-level +mkdir -p ~/Library/Fonts +cp -v fonts/*.otf ~/Library/Fonts +ls ~/Library/Fonts + +mkdir -p /Library/Fonts +sudo cp -v fonts/*.otf /Library/Fonts +ls /Library/Fonts + +# Reset the font server to recognize new fonts +atsutil databases -removeUser +atsutil server -shutdown +atsutil server -ping + +echo "--- :art: Generate Promo Screenshots" +git lfs install && git lfs fetch && git lfs pull +bundle exec fastlane create_promo_screenshots force:true + +echo "--- :arrow_up: Upload Final Screenshots" +buildkite-agent artifact upload "fastlane/screenshots/**/*" +buildkite-agent artifact upload "fastlane/promo_screenshots/**/*" \ No newline at end of file diff --git a/.buildkite/commands/take-screenshots.sh b/.buildkite/commands/take-screenshots.sh new file mode 100755 index 00000000000..caac879c667 --- /dev/null +++ b/.buildkite/commands/take-screenshots.sh @@ -0,0 +1,32 @@ +#!/bin/bash -eu + +if .buildkite/commands/should-skip-job.sh --job-type test; then + exit 0 +fi + +echo "--- :rubygems: Setting up Gems" +install_gems + +echo "--- :writing_hand: Copy Files" +mkdir -pv ~/.configure/woocommerce-ios/secrets +cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/project.env + +echo "--- :arrow_down: Download Screenshot App Artifacts" +buildkite-agent artifact download screenshot-artifacts.tar . +tar -xf screenshot-artifacts.tar -C fastlane/DerivedData/Build/Products/Debug-iphonesimulator/ + +echo "--- :gear: Setup Fastlane Dependencies" +bundle exec fastlane run configure_apply + +echo "--- :camera: Generate Screenshots for ${SCREENSHOT_LANGUAGE} (${SCREENSHOT_MODE} mode)" +bundle exec fastlane take_screenshots \ + languages:"${SCREENSHOT_LANGUAGE}" \ + mode:"${SCREENSHOT_MODE}" + +echo "--- :arrow_up: Upload Screenshots to S3" +# Create unique directory for this job's screenshots +SCREENSHOT_DIR="fastlane/screenshots-${SCREENSHOT_LANGUAGE}-${SCREENSHOT_MODE}" +if [ -d "fastlane/screenshots" ]; then + mv fastlane/screenshots "${SCREENSHOT_DIR}" + aws s3 cp "${SCREENSHOT_DIR}" "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID}/screenshots-${SCREENSHOT_LANGUAGE}-${SCREENSHOT_MODE}/" --recursive --exclude "*.html" +fi \ No newline at end of file diff --git a/.buildkite/screenshots-pipeline.yml b/.buildkite/screenshots-pipeline.yml new file mode 100644 index 00000000000..06547c768ea --- /dev/null +++ b/.buildkite/screenshots-pipeline.yml @@ -0,0 +1,87 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json +--- + +agents: + queue: mac + +env: + IMAGE_ID: $IMAGE_ID + S3_BUCKET: $S3_BUCKET + AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY + CONFIGURE_ENCRYPTION_KEY: $CONFIGURE_ENCRYPTION_KEY + +# Screenshots pipeline - triggered by PR label "generate screenshots" +steps: + ################# + # Build Screenshots App + ################# + - label: ":hammer_and_wrench: Build Screenshots App" + key: build-screenshots + command: .buildkite/commands/build-screenshots.sh + plugins: [$CI_TOOLKIT] + if: build.pull_request.labels includes "generate screenshots" + artifact_paths: + - "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerce.app/**/*" + - "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerceScreenshots-Runner.app/**/*" + - "screenshot-artifacts.tar" + notify: + - github_commit_status: + context: Build Screenshots App + + ################# + # Generate Screenshots (Matrix) + ################# + - label: ":camera: Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" + command: .buildkite/commands/take-screenshots.sh + depends_on: build-screenshots + plugins: [$CI_TOOLKIT] + if: build.pull_request.labels includes "generate screenshots" + matrix: + setup: + 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 + mode: + - dark + - light + env: + SCREENSHOT_LANGUAGE: "{{matrix.language}}" + SCREENSHOT_MODE: "{{matrix.mode}}" + artifact_paths: + - "fastlane/logs/**/*" + notify: + - github_commit_status: + context: "Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" + + ################# + # Process Screenshots + ################# + - label: ":framed_picture: Process Screenshots" + command: .buildkite/commands/process-screenshots.sh + depends_on: + - step: ":camera: Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" + allow_failure: false + plugins: [$CI_TOOLKIT] + if: build.pull_request.labels includes "generate screenshots" + artifact_paths: + - "fastlane/screenshots/**/*" + - "fastlane/promo_screenshots/**/*" + notify: + - github_commit_status: + context: Process Screenshots \ No newline at end of file From 2caeee9a378740e3b1c7bcbedd852077ec85836f Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 16:37:07 -0400 Subject: [PATCH 02/44] [WIP] Only run screenshots commands in CI for testing. --- .buildkite/pipeline.yml | 270 ++++++++++++++++++++++++++-------------- 1 file changed, 175 insertions(+), 95 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index c8267aadf8f..ead2fba96c1 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -6,120 +6,200 @@ agents: env: IMAGE_ID: $IMAGE_ID + S3_BUCKET: $S3_BUCKET + AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY + CONFIGURE_ENCRYPTION_KEY: $CONFIGURE_ENCRYPTION_KEY -# This is the default pipeline – it will build and test the app +# TEMPORARY: Screenshots pipeline only - other jobs commented out steps: ################# - # Build the app + # Build Screenshots App ################# - - label: ":pipeline: Build" - key: build - command: .buildkite/commands/build-for-testing.sh + - label: ":hammer_and_wrench: Build Screenshots App" + key: build-screenshots + command: .buildkite/commands/build-screenshots.sh plugins: [$CI_TOOLKIT] + if: build.pull_request.labels includes "generate screenshots" + artifact_paths: + - "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerce.app/**/*" + - "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerceScreenshots-Runner.app/**/*" + - "screenshot-artifacts.tar" notify: - github_commit_status: - context: Build - - ################# - # Create Prototype Build - ################# - - label: ":hammer_and_wrench: Prototype Build" - command: .buildkite/commands/prototype-build.sh - plugins: [$CI_TOOLKIT] - if: build.pull_request.id != null - notify: - - github_commit_status: - context: Prototype Build + context: Build Screenshots App ################# - # Run Unit Tests + # Generate Screenshots (Matrix) ################# - - label: ":microscope: Unit Tests" - command: .buildkite/commands/run-unit-tests.sh - depends_on: build - plugins: [$CI_TOOLKIT] - artifact_paths: - - fastlane/test_output/* - notify: - - github_commit_status: - context: Unit Tests - - - label: ":microscope: Standalone WordPressAuthenticator Unit Tests" - command: .buildkite/commands/run-wordpress-authenticator-tests.sh + - label: ":camera: Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" + command: .buildkite/commands/take-screenshots.sh + depends_on: build-screenshots plugins: [$CI_TOOLKIT] + if: build.pull_request.labels includes "generate screenshots" + matrix: + setup: + 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 + mode: + - dark + - light + env: + SCREENSHOT_LANGUAGE: "{{matrix.language}}" + SCREENSHOT_MODE: "{{matrix.mode}}" artifact_paths: - - fastlane/test_output/* + - "fastlane/logs/**/*" notify: - github_commit_status: - context: WordPressAuthenticator Unit Tests + context: "Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" ################# - # Linters - ################# - - group: Linters - steps: - - label: ":radioactive_sign: Danger - PR Check" - command: danger - key: danger - if: build.pull_request.id != null - retry: - manual: - permit_on_passed: true - agents: - queue: linter - notify: - - github_commit_status: - context: Danger - PR Check - - - label: ":swift: SwiftLint" - command: swiftlint - notify: - - github_commit_status: - context: SwiftLint - agents: - queue: linter - - - label: 🧹 Lint Translations - command: gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot - plugins: - - docker#v3.8.0: - image: public.ecr.aws/automattic/glotpress-validator:1.0.0 - agents: - queue: default - notify: - - github_commit_status: - context: Lint Translations - - - label: ":sleuth_or_spy: Lint Localized Strings Format" - command: .buildkite/commands/lint-localized-strings-format.sh - plugins: [$CI_TOOLKIT] - notify: - - github_commit_status: - context: Lint Localized Strings Format - + # Process Screenshots ################# - # UI Tests - ################# - - label: ":microscope: UI Tests (iPhone)" - command: .buildkite/commands/run-ui-tests.sh UITests "iPhone 16" - depends_on: build - # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 - if: build.branch == "trunk" || build.branch =~ /^release\// + - label: ":framed_picture: Process Screenshots" + command: .buildkite/commands/process-screenshots.sh + depends_on: + - step: ":camera: Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" + allow_failure: false plugins: [$CI_TOOLKIT] + if: build.pull_request.labels includes "generate screenshots" artifact_paths: - - fastlane/test_output/* + - "fastlane/screenshots/**/*" + - "fastlane/promo_screenshots/**/*" notify: - github_commit_status: - context: UI Tests (iPhone) + context: Process Screenshots - - label: ":microscope: UI Tests (iPad)" - command: .buildkite/commands/run-ui-tests.sh UITests "iPad Pro 13-inch (M4)" - depends_on: build - # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 - if: build.branch == "trunk" || build.branch =~ /^release\// - plugins: [$CI_TOOLKIT] - artifact_paths: - - fastlane/test_output/* - notify: - - github_commit_status: - context: UI Tests (iPad) +# COMMENTED OUT - Original pipeline jobs +# Uncomment these when screenshots testing is complete +# +# ################# +# # Build the app +# ################# +# - label: ":pipeline: Build" +# key: build +# command: .buildkite/commands/build-for-testing.sh +# plugins: [$CI_TOOLKIT] +# notify: +# - github_commit_status: +# context: Build +# +# ################# +# # Create Prototype Build +# ################# +# - label: ":hammer_and_wrench: Prototype Build" +# command: .buildkite/commands/prototype-build.sh +# plugins: [$CI_TOOLKIT] +# if: build.pull_request.id != null +# notify: +# - github_commit_status: +# context: Prototype Build +# +# ################# +# # Run Unit Tests +# ################# +# - label: ":microscope: Unit Tests" +# command: .buildkite/commands/run-unit-tests.sh +# depends_on: build +# plugins: [$CI_TOOLKIT] +# artifact_paths: +# - fastlane/test_output/* +# notify: +# - github_commit_status: +# context: Unit Tests +# +# - label: ":microscope: Standalone WordPressAuthenticator Unit Tests" +# command: .buildkite/commands/run-wordpress-authenticator-tests.sh +# plugins: [$CI_TOOLKIT] +# artifact_paths: +# - fastlane/test_output/* +# notify: +# - github_commit_status: +# context: WordPressAuthenticator Unit Tests +# +# ################# +# # Linters +# ################# +# - group: Linters +# steps: +# - label: ":radioactive_sign: Danger - PR Check" +# command: danger +# key: danger +# if: build.pull_request.id != null +# retry: +# manual: +# permit_on_passed: true +# agents: +# queue: linter +# notify: +# - github_commit_status: +# context: Danger - PR Check +# +# - label: ":swift: SwiftLint" +# command: swiftlint +# notify: +# - github_commit_status: +# context: SwiftLint +# agents: +# queue: linter +# +# - label: 🧹 Lint Translations +# command: gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot +# plugins: +# - docker#v3.8.0: +# image: public.ecr.aws/automattic/glotpress-validator:1.0.0 +# agents: +# queue: default +# notify: +# - github_commit_status: +# context: Lint Translations +# +# - label: ":sleuth_or_spy: Lint Localized Strings Format" +# command: .buildkite/commands/lint-localized-strings-format.sh +# plugins: [$CI_TOOLKIT] +# notify: +# - github_commit_status: +# context: Lint Localized Strings Format +# +# ################# +# # UI Tests +# ################# +# - label: ":microscope: UI Tests (iPhone)" +# command: .buildkite/commands/run-ui-tests.sh UITests "iPhone 16" +# depends_on: build +# # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 +# if: build.branch == "trunk" || build.branch =~ /^release\// +# plugins: [$CI_TOOLKIT] +# artifact_paths: +# - fastlane/test_output/* +# notify: +# - github_commit_status: +# context: UI Tests (iPhone) +# +# - label: ":microscope: UI Tests (iPad)" +# command: .buildkite/commands/run-ui-tests.sh UITests "iPad Pro 13-inch (M4)" +# depends_on: build +# # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 +# if: build.branch == "trunk" || build.branch =~ /^release\// +# plugins: [$CI_TOOLKIT] +# artifact_paths: +# - fastlane/test_output/* +# notify: +# - github_commit_status: +# context: UI Tests (iPad) From 9b2e082c4d5e34e9cc05ac2b002cd37aea291140 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 16:39:28 -0400 Subject: [PATCH 03/44] [WIP] Try fixing `fatal: Failed to upload and process pipeline: Pipeline upload rejected: `step` may only contain alphanumeric characters, slashes, dashes or underscores`. --- .buildkite/pipeline.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index ead2fba96c1..fa9405e7b2f 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -33,6 +33,7 @@ steps: # Generate Screenshots (Matrix) ################# - label: ":camera: Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" + key: "generate-screenshots" command: .buildkite/commands/take-screenshots.sh depends_on: build-screenshots plugins: [$CI_TOOLKIT] @@ -74,9 +75,7 @@ steps: ################# - label: ":framed_picture: Process Screenshots" command: .buildkite/commands/process-screenshots.sh - depends_on: - - step: ":camera: Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" - allow_failure: false + depends_on: generate-screenshots plugins: [$CI_TOOLKIT] if: build.pull_request.labels includes "generate screenshots" artifact_paths: From afd89c0acbb5087c87d88d535860854270a41c5b Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 16:55:55 -0400 Subject: [PATCH 04/44] [WIP] Try fixing canceled `take-screenshots` tasks. --- .buildkite/commands/take-screenshots.sh | 4 ---- .buildkite/pipeline.yml | 30 ++++++++++++------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.buildkite/commands/take-screenshots.sh b/.buildkite/commands/take-screenshots.sh index caac879c667..b37321ebb03 100755 --- a/.buildkite/commands/take-screenshots.sh +++ b/.buildkite/commands/take-screenshots.sh @@ -1,9 +1,5 @@ #!/bin/bash -eu -if .buildkite/commands/should-skip-job.sh --job-type test; then - exit 0 -fi - echo "--- :rubygems: Setting up Gems" install_gems diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index fa9405e7b2f..576d95f3c93 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -41,22 +41,22 @@ steps: matrix: setup: language: - - ar - - de-DE + # - ar + # - de-DE - en-US - - es-ES - - fr-FR - - he - - id - - it - - ja - - ko - - nl-NL - - pt-BR - - ru - - sv - - tr - - zh-Hans + # - es-ES + # - fr-FR + # - he + # - id + # - it + # - ja + # - ko + # - nl-NL + # - pt-BR + # - ru + # - sv + # - tr + # - zh-Hans - zh-Hant mode: - dark From 7816c7910f768b63f0c5f922f5a3afbb01d45d64 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 17:10:51 -0400 Subject: [PATCH 05/44] [WIP] Try fixing error `buildkite-agent: fatal: failed to download artifacts: GET ...: 400 Bad Request: Multiple artifacts were found for query: `screenshot-artifacts.tar`. Try scoping by the job ID or name.`. --- .buildkite/commands/take-screenshots.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/commands/take-screenshots.sh b/.buildkite/commands/take-screenshots.sh index b37321ebb03..143cca42035 100755 --- a/.buildkite/commands/take-screenshots.sh +++ b/.buildkite/commands/take-screenshots.sh @@ -8,7 +8,7 @@ mkdir -pv ~/.configure/woocommerce-ios/secrets cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/project.env echo "--- :arrow_down: Download Screenshot App Artifacts" -buildkite-agent artifact download screenshot-artifacts.tar . +buildkite-agent artifact download screenshot-artifacts.tar . --job "build-app-for-screenshots" tar -xf screenshot-artifacts.tar -C fastlane/DerivedData/Build/Products/Debug-iphonesimulator/ echo "--- :gear: Setup Fastlane Dependencies" From f719660b4b6bc1ca2fed0197646fe400d46758c4 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 17:16:08 -0400 Subject: [PATCH 06/44] [WIP] Try caching build-screenshots to avoid unnecessary 8m execution every CI run. --- .buildkite/pipeline.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 576d95f3c93..259987a7f22 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -19,7 +19,13 @@ steps: - label: ":hammer_and_wrench: Build Screenshots App" key: build-screenshots command: .buildkite/commands/build-screenshots.sh - plugins: [$CI_TOOLKIT] + plugins: + - cache#v1.1.0: + cache_key: "screenshots-build-v1-{{ checksum 'WooCommerce.xcodeproj/project.pbxproj' }}-{{ checksum 'Podfile.lock' }}" + paths: + - "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/" + - "screenshot-artifacts.tar" + - $CI_TOOLKIT if: build.pull_request.labels includes "generate screenshots" artifact_paths: - "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerce.app/**/*" From 4038f9827f03235ca741e12b67488c7cb76c78a8 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 17:22:52 -0400 Subject: [PATCH 07/44] [WIP] Try fixing download artifacts issue again. --- .buildkite/commands/take-screenshots.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/commands/take-screenshots.sh b/.buildkite/commands/take-screenshots.sh index 143cca42035..db85597e221 100755 --- a/.buildkite/commands/take-screenshots.sh +++ b/.buildkite/commands/take-screenshots.sh @@ -8,7 +8,7 @@ mkdir -pv ~/.configure/woocommerce-ios/secrets cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/project.env echo "--- :arrow_down: Download Screenshot App Artifacts" -buildkite-agent artifact download screenshot-artifacts.tar . --job "build-app-for-screenshots" +buildkite-agent artifact download screenshot-artifacts.tar . --job "build-screenshots" tar -xf screenshot-artifacts.tar -C fastlane/DerivedData/Build/Products/Debug-iphonesimulator/ echo "--- :gear: Setup Fastlane Dependencies" From 444a6e1891396a53bb0e5bd1fdc1b3843057fe9e Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 17:27:20 -0400 Subject: [PATCH 08/44] =?UTF-8?q?[WIP]=20Try=20fixing=20error=20`Running?= =?UTF-8?q?=20plugin=20cache=20post-checkout=20hook=20=F0=9F=9A=A8=20Missi?= =?UTF-8?q?ng=20path=20option=20in=20the=20cache=20plugin=20to=20restore?= =?UTF-8?q?=20=F0=9F=9A=A8=20Error:=20running=20"plugin=20cache=20post-che?= =?UTF-8?q?ckout"=20shell=20hook:=20The=20plugin=20cache=20post-checkout?= =?UTF-8?q?=20hook=20exited=20with=20status=201`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .buildkite/pipeline.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 259987a7f22..b44f08d7000 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -22,9 +22,8 @@ steps: plugins: - cache#v1.1.0: cache_key: "screenshots-build-v1-{{ checksum 'WooCommerce.xcodeproj/project.pbxproj' }}-{{ checksum 'Podfile.lock' }}" - paths: - - "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/" - - "screenshot-artifacts.tar" + restore: "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/" + save: "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/" - $CI_TOOLKIT if: build.pull_request.labels includes "generate screenshots" artifact_paths: From a4f18d0cc4439a00338408222ba113ac62639238 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 17:31:59 -0400 Subject: [PATCH 09/44] [WIP] Try fixing cache again. --- .buildkite/pipeline.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index b44f08d7000..4cd0213836a 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -20,10 +20,13 @@ steps: key: build-screenshots command: .buildkite/commands/build-screenshots.sh plugins: - - cache#v1.1.0: - cache_key: "screenshots-build-v1-{{ checksum 'WooCommerce.xcodeproj/project.pbxproj' }}-{{ checksum 'Podfile.lock' }}" - restore: "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/" - save: "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/" + - cache#v1.7.0: + path: "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/" + manifest: + - "WooCommerce.xcodeproj/project.pbxproj" + - "Podfile.lock" + restore: file + save: file - $CI_TOOLKIT if: build.pull_request.labels includes "generate screenshots" artifact_paths: From d9674d6762a83feef052dc772e94f9ef1312e516 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 17:41:16 -0400 Subject: [PATCH 10/44] [WIP] Try fixing `Uploading artifacts` error. --- .buildkite/commands/build-screenshots.sh | 19 ++++++++++++++++--- .buildkite/pipeline.yml | 6 +----- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.buildkite/commands/build-screenshots.sh b/.buildkite/commands/build-screenshots.sh index febb0ba2a47..5b22f70410a 100755 --- a/.buildkite/commands/build-screenshots.sh +++ b/.buildkite/commands/build-screenshots.sh @@ -14,14 +14,27 @@ echo "--- :writing_hand: Copy Files" mkdir -pv ~/.configure/woocommerce-ios/secrets cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/project.env -echo "--- :hammer_and_wrench: Building Screenshots App" -bundle exec fastlane build_screenshots +# Check if cached apps exist +if [ -d "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerce.app" ] && \ + [ -d "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerceScreenshots-Runner.app" ]; then + echo "--- :white_check_mark: Using Cached Screenshots App" +else + echo "--- :hammer_and_wrench: Building Screenshots App" + bundle exec fastlane build_screenshots +fi + +echo "--- :package: Create Screenshot App Artifacts" +# Ensure the build products directory exists +if [ ! -d "fastlane/DerivedData/Build/Products/Debug-iphonesimulator" ]; then + echo "Error: Build products directory not found" + exit 1 +fi -echo "--- :arrow_up: Upload Screenshot App Artifacts" # Create a structured archive of the built apps tar -cf screenshot-artifacts.tar \ -C fastlane/DerivedData/Build/Products/Debug-iphonesimulator \ WooCommerce.app \ WooCommerceScreenshots-Runner.app +echo "--- :arrow_up: Upload Screenshot App Artifacts" buildkite-agent artifact upload screenshot-artifacts.tar \ No newline at end of file diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 4cd0213836a..9c43b95fb4d 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -19,7 +19,7 @@ steps: - label: ":hammer_and_wrench: Build Screenshots App" key: build-screenshots command: .buildkite/commands/build-screenshots.sh - plugins: + plugins: - cache#v1.7.0: path: "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/" manifest: @@ -29,10 +29,6 @@ steps: save: file - $CI_TOOLKIT if: build.pull_request.labels includes "generate screenshots" - artifact_paths: - - "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerce.app/**/*" - - "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerceScreenshots-Runner.app/**/*" - - "screenshot-artifacts.tar" notify: - github_commit_status: context: Build Screenshots App From dd8158120592af7742465a60dcf2957c43578dd7 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 17:43:08 -0400 Subject: [PATCH 11/44] [WIP] Another attempt. --- .buildkite/commands/build-screenshots.sh | 19 +++---------------- .buildkite/pipeline.yml | 10 +--------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/.buildkite/commands/build-screenshots.sh b/.buildkite/commands/build-screenshots.sh index 5b22f70410a..febb0ba2a47 100755 --- a/.buildkite/commands/build-screenshots.sh +++ b/.buildkite/commands/build-screenshots.sh @@ -14,27 +14,14 @@ echo "--- :writing_hand: Copy Files" mkdir -pv ~/.configure/woocommerce-ios/secrets cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/project.env -# Check if cached apps exist -if [ -d "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerce.app" ] && \ - [ -d "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerceScreenshots-Runner.app" ]; then - echo "--- :white_check_mark: Using Cached Screenshots App" -else - echo "--- :hammer_and_wrench: Building Screenshots App" - bundle exec fastlane build_screenshots -fi - -echo "--- :package: Create Screenshot App Artifacts" -# Ensure the build products directory exists -if [ ! -d "fastlane/DerivedData/Build/Products/Debug-iphonesimulator" ]; then - echo "Error: Build products directory not found" - exit 1 -fi +echo "--- :hammer_and_wrench: Building Screenshots App" +bundle exec fastlane build_screenshots +echo "--- :arrow_up: Upload Screenshot App Artifacts" # Create a structured archive of the built apps tar -cf screenshot-artifacts.tar \ -C fastlane/DerivedData/Build/Products/Debug-iphonesimulator \ WooCommerce.app \ WooCommerceScreenshots-Runner.app -echo "--- :arrow_up: Upload Screenshot App Artifacts" buildkite-agent artifact upload screenshot-artifacts.tar \ No newline at end of file diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 9c43b95fb4d..6fd4c470afa 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -19,15 +19,7 @@ steps: - label: ":hammer_and_wrench: Build Screenshots App" key: build-screenshots command: .buildkite/commands/build-screenshots.sh - plugins: - - cache#v1.7.0: - path: "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/" - manifest: - - "WooCommerce.xcodeproj/project.pbxproj" - - "Podfile.lock" - restore: file - save: file - - $CI_TOOLKIT + plugins: [$CI_TOOLKIT] if: build.pull_request.labels includes "generate screenshots" notify: - github_commit_status: From ebc89b323ae052ee341e48aaf54bc633c42442c1 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 17:55:01 -0400 Subject: [PATCH 12/44] [WIP] Try fixing `tar: could not chdir to 'fastlane/DerivedData/Build/Products/Debug-iphonesimulator/'`. --- .buildkite/commands/take-screenshots.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/commands/take-screenshots.sh b/.buildkite/commands/take-screenshots.sh index db85597e221..390326fb143 100755 --- a/.buildkite/commands/take-screenshots.sh +++ b/.buildkite/commands/take-screenshots.sh @@ -9,6 +9,7 @@ cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/proj echo "--- :arrow_down: Download Screenshot App Artifacts" buildkite-agent artifact download screenshot-artifacts.tar . --job "build-screenshots" +mkdir -p fastlane/DerivedData/Build/Products/Debug-iphonesimulator/ tar -xf screenshot-artifacts.tar -C fastlane/DerivedData/Build/Products/Debug-iphonesimulator/ echo "--- :gear: Setup Fastlane Dependencies" From 9f6eb2e821adf82d3a865495be53c463aa8792ec Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 18:08:50 -0400 Subject: [PATCH 13/44] [WIP] Try fixing `./.buildkite/commands/take-screenshots.sh: line 18: SCREENSHOT_LANGUAGE: unbound variable`. --- .buildkite/commands/take-screenshots.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.buildkite/commands/take-screenshots.sh b/.buildkite/commands/take-screenshots.sh index 390326fb143..4b31a673cd3 100755 --- a/.buildkite/commands/take-screenshots.sh +++ b/.buildkite/commands/take-screenshots.sh @@ -15,15 +15,19 @@ tar -xf screenshot-artifacts.tar -C fastlane/DerivedData/Build/Products/Debug-ip echo "--- :gear: Setup Fastlane Dependencies" bundle exec fastlane run configure_apply -echo "--- :camera: Generate Screenshots for ${SCREENSHOT_LANGUAGE} (${SCREENSHOT_MODE} mode)" +echo "--- :information_source: Debug Environment Variables" +echo "SCREENSHOT_LANGUAGE: '${SCREENSHOT_LANGUAGE:-NOT_SET}'" +echo "SCREENSHOT_MODE: '${SCREENSHOT_MODE:-NOT_SET}'" + +echo "--- :camera: Generate Screenshots for ${SCREENSHOT_LANGUAGE:-unknown} (${SCREENSHOT_MODE:-unknown} mode)" bundle exec fastlane take_screenshots \ - languages:"${SCREENSHOT_LANGUAGE}" \ - mode:"${SCREENSHOT_MODE}" + languages:"${SCREENSHOT_LANGUAGE:-en-US}" \ + mode:"${SCREENSHOT_MODE:-light}" echo "--- :arrow_up: Upload Screenshots to S3" # Create unique directory for this job's screenshots -SCREENSHOT_DIR="fastlane/screenshots-${SCREENSHOT_LANGUAGE}-${SCREENSHOT_MODE}" +SCREENSHOT_DIR="fastlane/screenshots-${SCREENSHOT_LANGUAGE:-en-US}-${SCREENSHOT_MODE:-light}" if [ -d "fastlane/screenshots" ]; then mv fastlane/screenshots "${SCREENSHOT_DIR}" - aws s3 cp "${SCREENSHOT_DIR}" "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID}/screenshots-${SCREENSHOT_LANGUAGE}-${SCREENSHOT_MODE}/" --recursive --exclude "*.html" + aws s3 cp "${SCREENSHOT_DIR}" "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID}/screenshots-${SCREENSHOT_LANGUAGE:-en-US}-${SCREENSHOT_MODE:-light}/" --recursive --exclude "*.html" fi \ No newline at end of file From 52aa932e1e0ebd3ea12c5d07e2efed2358119790 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 19:10:20 -0400 Subject: [PATCH 14/44] =?UTF-8?q?[WIP]=20Try=20fixing=20`Testing=20failed:?= =?UTF-8?q?=20=09WooCommerceScreenshots-Runner=20(3506)=20encountered=20an?= =?UTF-8?q?=20error=20(Failed=20to=20load=20the=20test=20bundle.=20(Underl?= =?UTF-8?q?ying=20Error:=20The=20bundle=20=E2=80=9CWooCommerceScreenshots?= =?UTF-8?q?=E2=80=9D=20couldn=E2=80=99t=20be=20loaded.=20The=20bundle=20co?= =?UTF-8?q?uldn=E2=80=99t=20be=20loaded.=20Try=20reinstalling=20the=20bund?= =?UTF-8?q?le.`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .buildkite/commands/build-screenshots.sh | 5 ++--- .buildkite/pipeline.yml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.buildkite/commands/build-screenshots.sh b/.buildkite/commands/build-screenshots.sh index febb0ba2a47..c5ea3e58592 100755 --- a/.buildkite/commands/build-screenshots.sh +++ b/.buildkite/commands/build-screenshots.sh @@ -18,10 +18,9 @@ echo "--- :hammer_and_wrench: Building Screenshots App" bundle exec fastlane build_screenshots echo "--- :arrow_up: Upload Screenshot App Artifacts" -# Create a structured archive of the built apps +# Create a structured archive of all build products (apps, frameworks, etc.) tar -cf screenshot-artifacts.tar \ -C fastlane/DerivedData/Build/Products/Debug-iphonesimulator \ - WooCommerce.app \ - WooCommerceScreenshots-Runner.app + . buildkite-agent artifact upload screenshot-artifacts.tar \ No newline at end of file diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 6fd4c470afa..49a9e634196 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -53,10 +53,10 @@ steps: # - sv # - tr # - zh-Hans - - zh-Hant + # - zh-Hant mode: - dark - - light + # - light env: SCREENSHOT_LANGUAGE: "{{matrix.language}}" SCREENSHOT_MODE: "{{matrix.mode}}" From 040dd351dcc26067dd8fdfedcda53d43109e938d Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 19:35:53 -0400 Subject: [PATCH 15/44] [WIP] Try fixing `./.buildkite/commands/take-screenshots.sh: line 32: S3_BUCKET: unbound variable` error. --- .buildkite/pipeline.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 49a9e634196..42c563bd870 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -60,6 +60,10 @@ steps: env: SCREENSHOT_LANGUAGE: "{{matrix.language}}" SCREENSHOT_MODE: "{{matrix.mode}}" + S3_BUCKET: $S3_BUCKET + AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY + BUILDKITE_BUILD_ID: $BUILDKITE_BUILD_ID artifact_paths: - "fastlane/logs/**/*" notify: From b1a04516c9833ab4e7bbf04face886f04ecd1e48 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Wed, 25 Jun 2025 20:03:31 -0400 Subject: [PATCH 16/44] [WIP] Try fixing env variables not set again. --- .buildkite/commands/take-screenshots.sh | 25 +++++++++++++++++-------- .buildkite/pipeline.yml | 6 +----- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.buildkite/commands/take-screenshots.sh b/.buildkite/commands/take-screenshots.sh index 4b31a673cd3..86f8ddee837 100755 --- a/.buildkite/commands/take-screenshots.sh +++ b/.buildkite/commands/take-screenshots.sh @@ -1,5 +1,9 @@ #!/bin/bash -eu +# Get matrix values from command arguments +SCREENSHOT_LANGUAGE="${1:-en-US}" +SCREENSHOT_MODE="${2:-light}" + echo "--- :rubygems: Setting up Gems" install_gems @@ -15,19 +19,24 @@ tar -xf screenshot-artifacts.tar -C fastlane/DerivedData/Build/Products/Debug-ip echo "--- :gear: Setup Fastlane Dependencies" bundle exec fastlane run configure_apply -echo "--- :information_source: Debug Environment Variables" -echo "SCREENSHOT_LANGUAGE: '${SCREENSHOT_LANGUAGE:-NOT_SET}'" -echo "SCREENSHOT_MODE: '${SCREENSHOT_MODE:-NOT_SET}'" +echo "--- :information_source: Screenshot Configuration" +echo "SCREENSHOT_LANGUAGE: '${SCREENSHOT_LANGUAGE}'" +echo "SCREENSHOT_MODE: '${SCREENSHOT_MODE}'" -echo "--- :camera: Generate Screenshots for ${SCREENSHOT_LANGUAGE:-unknown} (${SCREENSHOT_MODE:-unknown} mode)" +echo "--- :camera: Generate Screenshots for ${SCREENSHOT_LANGUAGE} (${SCREENSHOT_MODE} mode)" bundle exec fastlane take_screenshots \ - languages:"${SCREENSHOT_LANGUAGE:-en-US}" \ - mode:"${SCREENSHOT_MODE:-light}" + languages:"${SCREENSHOT_LANGUAGE}" \ + mode:"${SCREENSHOT_MODE}" echo "--- :arrow_up: Upload Screenshots to S3" # Create unique directory for this job's screenshots -SCREENSHOT_DIR="fastlane/screenshots-${SCREENSHOT_LANGUAGE:-en-US}-${SCREENSHOT_MODE:-light}" +SCREENSHOT_DIR="fastlane/screenshots-${SCREENSHOT_LANGUAGE}-${SCREENSHOT_MODE}" if [ -d "fastlane/screenshots" ]; then mv fastlane/screenshots "${SCREENSHOT_DIR}" - aws s3 cp "${SCREENSHOT_DIR}" "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID}/screenshots-${SCREENSHOT_LANGUAGE:-en-US}-${SCREENSHOT_MODE:-light}/" --recursive --exclude "*.html" + # Check if S3_BUCKET is set before uploading + if [ -n "${S3_BUCKET:-}" ]; then + aws s3 cp "${SCREENSHOT_DIR}" "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID:-unknown}/screenshots-${SCREENSHOT_LANGUAGE}-${SCREENSHOT_MODE}/" --recursive --exclude "*.html" + else + echo "S3_BUCKET not set, skipping upload" + fi fi \ No newline at end of file diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 42c563bd870..9fc8dac8f64 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -29,8 +29,7 @@ steps: # Generate Screenshots (Matrix) ################# - label: ":camera: Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" - key: "generate-screenshots" - command: .buildkite/commands/take-screenshots.sh + command: .buildkite/commands/take-screenshots.sh "{{matrix.language}}" "{{matrix.mode}}" depends_on: build-screenshots plugins: [$CI_TOOLKIT] if: build.pull_request.labels includes "generate screenshots" @@ -58,12 +57,9 @@ steps: - dark # - light env: - SCREENSHOT_LANGUAGE: "{{matrix.language}}" - SCREENSHOT_MODE: "{{matrix.mode}}" S3_BUCKET: $S3_BUCKET AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY - BUILDKITE_BUILD_ID: $BUILDKITE_BUILD_ID artifact_paths: - "fastlane/logs/**/*" notify: From 83acffeaa9ad4acc660b21c11f2e8370a042d2f3 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 09:42:00 -0400 Subject: [PATCH 17/44] Use Buildkite artifacts instead of S3 since we don't know the credentials from GHA. --- .buildkite/commands/process-screenshots.sh | 45 +++++++++++++--------- .buildkite/commands/take-screenshots.sh | 10 ++--- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/.buildkite/commands/process-screenshots.sh b/.buildkite/commands/process-screenshots.sh index bbdb76d2357..59915556c64 100755 --- a/.buildkite/commands/process-screenshots.sh +++ b/.buildkite/commands/process-screenshots.sh @@ -21,33 +21,40 @@ cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/proj echo "--- :gear: Setup Fastlane Dependencies" bundle exec fastlane run configure_apply -echo "--- :arrow_down: Download Generated Screenshots from S3" +echo "--- :arrow_down: Download Generated Screenshots from CI Artifacts" cd fastlane mkdir -p screenshots -aws s3 cp "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID}/" screenshots/ --recursive --exclude "*.html" +# Download all screenshot artifacts from the take-screenshots jobs +buildkite-agent artifact download "fastlane/screenshots-*/**/*" . --step "take-screenshots" echo "--- :chart_with_upwards_trend: Generate Screenshot Summary" bundle exec fastlane create_screenshot_summary -aws s3 cp screenshots/screenshots.html "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID}/screenshots/screenshots.html" echo "--- :arrow_down: Install Promo Screenshot Fonts" cd .. -aws s3 cp "s3://${S3_BUCKET}/fonts.zip" fonts.zip -unzip fonts.zip - -# Install fonts system-wide and user-level -mkdir -p ~/Library/Fonts -cp -v fonts/*.otf ~/Library/Fonts -ls ~/Library/Fonts - -mkdir -p /Library/Fonts -sudo cp -v fonts/*.otf /Library/Fonts -ls /Library/Fonts - -# Reset the font server to recognize new fonts -atsutil databases -removeUser -atsutil server -shutdown -atsutil server -ping +# Download fonts from artifacts (assuming fonts are uploaded as artifacts in a separate step) +buildkite-agent artifact download "fonts.zip" . --step "prepare-fonts" || echo "No fonts artifact found, continuing without promo fonts" +if [ -f "fonts.zip" ]; then + unzip fonts.zip +fi + +# Install fonts system-wide and user-level (only if fonts exist) +if [ -d "fonts" ] && [ "$(ls -A fonts/*.otf 2>/dev/null)" ]; then + mkdir -p ~/Library/Fonts + cp -v fonts/*.otf ~/Library/Fonts + ls ~/Library/Fonts + + mkdir -p /Library/Fonts + sudo cp -v fonts/*.otf /Library/Fonts + ls /Library/Fonts + + # Reset the font server to recognize new fonts + atsutil databases -removeUser + atsutil server -shutdown + atsutil server -ping +else + echo "No fonts found, skipping font installation" +fi echo "--- :art: Generate Promo Screenshots" git lfs install && git lfs fetch && git lfs pull diff --git a/.buildkite/commands/take-screenshots.sh b/.buildkite/commands/take-screenshots.sh index 86f8ddee837..2e09f5f73d5 100755 --- a/.buildkite/commands/take-screenshots.sh +++ b/.buildkite/commands/take-screenshots.sh @@ -28,15 +28,11 @@ bundle exec fastlane take_screenshots \ languages:"${SCREENSHOT_LANGUAGE}" \ mode:"${SCREENSHOT_MODE}" -echo "--- :arrow_up: Upload Screenshots to S3" +echo "--- :arrow_up: Upload Screenshots as CI Artifacts" # Create unique directory for this job's screenshots SCREENSHOT_DIR="fastlane/screenshots-${SCREENSHOT_LANGUAGE}-${SCREENSHOT_MODE}" if [ -d "fastlane/screenshots" ]; then mv fastlane/screenshots "${SCREENSHOT_DIR}" - # Check if S3_BUCKET is set before uploading - if [ -n "${S3_BUCKET:-}" ]; then - aws s3 cp "${SCREENSHOT_DIR}" "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID:-unknown}/screenshots-${SCREENSHOT_LANGUAGE}-${SCREENSHOT_MODE}/" --recursive --exclude "*.html" - else - echo "S3_BUCKET not set, skipping upload" - fi + # Upload as Buildkite artifacts for later processing + buildkite-agent artifact upload "${SCREENSHOT_DIR}/**/*" --job "${BUILDKITE_JOB_ID}" fi \ No newline at end of file From 91cbef9be4e7c360ae56e8706dbeadff089995a8 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 09:44:07 -0400 Subject: [PATCH 18/44] Remove custom font download and installation as it should be available in macOS Sonoma and above. --- .buildkite/commands/process-screenshots.sh | 29 ++++++---------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/.buildkite/commands/process-screenshots.sh b/.buildkite/commands/process-screenshots.sh index 59915556c64..8d5f457f715 100755 --- a/.buildkite/commands/process-screenshots.sh +++ b/.buildkite/commands/process-screenshots.sh @@ -30,30 +30,15 @@ buildkite-agent artifact download "fastlane/screenshots-*/**/*" . --step "take-s echo "--- :chart_with_upwards_trend: Generate Screenshot Summary" bundle exec fastlane create_screenshot_summary -echo "--- :arrow_down: Install Promo Screenshot Fonts" +echo "--- :information_source: Check Font Availability" cd .. -# Download fonts from artifacts (assuming fonts are uploaded as artifacts in a separate step) -buildkite-agent artifact download "fonts.zip" . --step "prepare-fonts" || echo "No fonts artifact found, continuing without promo fonts" -if [ -f "fonts.zip" ]; then - unzip fonts.zip -fi - -# Install fonts system-wide and user-level (only if fonts exist) -if [ -d "fonts" ] && [ "$(ls -A fonts/*.otf 2>/dev/null)" ]; then - mkdir -p ~/Library/Fonts - cp -v fonts/*.otf ~/Library/Fonts - ls ~/Library/Fonts - - mkdir -p /Library/Fonts - sudo cp -v fonts/*.otf /Library/Fonts - ls /Library/Fonts - - # Reset the font server to recognize new fonts - atsutil databases -removeUser - atsutil server -shutdown - atsutil server -ping +# Check if Proxima Nova is available (should be included in macOS Sonoma and above) +if fc-list | grep -i "proxima" > /dev/null 2>&1; then + echo "Proxima Nova font found" +elif system_profiler SPFontsDataType | grep -i "proxima" > /dev/null 2>&1; then + echo "Proxima Nova font found via system_profiler" else - echo "No fonts found, skipping font installation" + echo "Warning: Proxima Nova font not found - promo screenshots may not render correctly" fi echo "--- :art: Generate Promo Screenshots" From 3408a99c830f2b573f4c11b7774b9db503eaa910 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 09:54:21 -0400 Subject: [PATCH 19/44] Remove S3 variables in pipeline. --- .buildkite/pipeline.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 9fc8dac8f64..01d7cb49b81 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -6,9 +6,6 @@ agents: env: IMAGE_ID: $IMAGE_ID - S3_BUCKET: $S3_BUCKET - AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY CONFIGURE_ENCRYPTION_KEY: $CONFIGURE_ENCRYPTION_KEY # TEMPORARY: Screenshots pipeline only - other jobs commented out @@ -56,10 +53,6 @@ steps: mode: - dark # - light - env: - S3_BUCKET: $S3_BUCKET - AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY artifact_paths: - "fastlane/logs/**/*" notify: From 97d7b69fce6cb0290544ccf0d958c7e13d83fbe2 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 10:03:51 -0400 Subject: [PATCH 20/44] Try fixing GHA Xcode version error by running on macOS 15 image. --- .github/workflows/screenshots.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index f379be4ff7f..6b183a63335 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -14,7 +14,7 @@ jobs: build: name: Build Application if: contains(github.event.pull_request.labels.*.name, 'generate screenshots') - runs-on: macos-latest + runs-on: macos-15 steps: - name: "Check out Project" @@ -45,12 +45,12 @@ jobs: 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] - mode: [dark, light] + language: [en-US] + mode: [dark] steps: - uses: actions/checkout@v4 - name: "Set up Ruby" @@ -92,7 +92,7 @@ jobs: process: name: "Process Screenshots" needs: capture - runs-on: macos-latest + runs-on: macos-15 steps: - uses: actions/checkout@v4 From ad1db4f50535b88cb6576f6973a6b46b08872d06 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 10:15:22 -0400 Subject: [PATCH 21/44] Fix `The following step dependencies were not found during the build: generate-screenshots` error. --- .buildkite/commands/process-screenshots.sh | 2 +- .buildkite/pipeline.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.buildkite/commands/process-screenshots.sh b/.buildkite/commands/process-screenshots.sh index 8d5f457f715..7d1fedf2d9d 100755 --- a/.buildkite/commands/process-screenshots.sh +++ b/.buildkite/commands/process-screenshots.sh @@ -25,7 +25,7 @@ echo "--- :arrow_down: Download Generated Screenshots from CI Artifacts" cd fastlane mkdir -p screenshots # Download all screenshot artifacts from the take-screenshots jobs -buildkite-agent artifact download "fastlane/screenshots-*/**/*" . --step "take-screenshots" +buildkite-agent artifact download "fastlane/screenshots-*/**/*" . --step "generate-screenshots" echo "--- :chart_with_upwards_trend: Generate Screenshot Summary" bundle exec fastlane create_screenshot_summary diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 01d7cb49b81..182d4b1eee8 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -26,6 +26,7 @@ steps: # Generate Screenshots (Matrix) ################# - label: ":camera: Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" + key: generate-screenshots command: .buildkite/commands/take-screenshots.sh "{{matrix.language}}" "{{matrix.mode}}" depends_on: build-screenshots plugins: [$CI_TOOLKIT] From d34e8b127d5073c9876f81a6cc46be6811eba34b Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 10:46:50 -0400 Subject: [PATCH 22/44] =?UTF-8?q?GHA:=20try=20fixing=20`WooCommerceScreens?= =?UTF-8?q?hots-Runner=20(19200)=20encountered=20an=20error=20(Failed=20to?= =?UTF-8?q?=20load=20the=20test=20bundle.=20(Underlying=20Error:=20The=20b?= =?UTF-8?q?undle=20=E2=80=9CWooCommerceScreenshots=E2=80=9D=20couldn?= =?UTF-8?q?=E2=80=99t=20be=20loaded`=20error.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/screenshots.yml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 6b183a63335..99c5d29f022 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -30,17 +30,11 @@ 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/ capture: name: Capture @@ -61,17 +55,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/ - name: Generate Screenshots run: | From b733d22a779831ba49cc762e2eb73487bd8bcc69 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 10:47:41 -0400 Subject: [PATCH 23/44] =?UTF-8?q?Buildkite:=20try=20fixing=20`LFS=20not=20?= =?UTF-8?q?enabled=20=E2=80=93=20unable=20to=20generate=20promo=20screensh?= =?UTF-8?q?ots.=20Run=20`git=20lfs=20install=20&&=20git=20lfs=20fetch=20&&?= =?UTF-8?q?=20git=20lfs=20pull`=20to=20fix=20this.`=20error.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .buildkite/commands/process-screenshots.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.buildkite/commands/process-screenshots.sh b/.buildkite/commands/process-screenshots.sh index 7d1fedf2d9d..0086fc66d20 100755 --- a/.buildkite/commands/process-screenshots.sh +++ b/.buildkite/commands/process-screenshots.sh @@ -41,8 +41,10 @@ else echo "Warning: Proxima Nova font not found - promo screenshots may not render correctly" fi -echo "--- :art: Generate Promo Screenshots" +echo "--- :package: Setup Git LFS" git lfs install && git lfs fetch && git lfs pull + +echo "--- :art: Generate Promo Screenshots" bundle exec fastlane create_promo_screenshots force:true echo "--- :arrow_up: Upload Final Screenshots" From 2d980bcf5be398e66db3c13193484e631c712667 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 10:50:14 -0400 Subject: [PATCH 24/44] Buildkite: temporarily remove PR label requirement. --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 182d4b1eee8..35f399ce2ca 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -17,7 +17,7 @@ steps: key: build-screenshots command: .buildkite/commands/build-screenshots.sh plugins: [$CI_TOOLKIT] - if: build.pull_request.labels includes "generate screenshots" + # if: build.pull_request.labels includes "generate screenshots" notify: - github_commit_status: context: Build Screenshots App From 79a93a25911a35bb246fbfba4f09f89e423c4a08 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 11:20:53 -0400 Subject: [PATCH 25/44] Buildkite: try fixing remaining LFS issue. --- .buildkite/commands/process-screenshots.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.buildkite/commands/process-screenshots.sh b/.buildkite/commands/process-screenshots.sh index 0086fc66d20..5c124d2e58e 100755 --- a/.buildkite/commands/process-screenshots.sh +++ b/.buildkite/commands/process-screenshots.sh @@ -42,7 +42,10 @@ else fi echo "--- :package: Setup Git LFS" +cd .. # Make sure we're in the repo root +pwd git lfs install && git lfs fetch && git lfs pull +git config --get-regex lfs || echo "No LFS config found" echo "--- :art: Generate Promo Screenshots" bundle exec fastlane create_promo_screenshots force:true From 3e3031634629b076c40d7639267b23f0bd3229bb Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 12:47:46 -0400 Subject: [PATCH 26/44] Buildkite: try fixing errors in process-screenshots. --- .buildkite/commands/process-screenshots.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.buildkite/commands/process-screenshots.sh b/.buildkite/commands/process-screenshots.sh index 5c124d2e58e..fb48783ef44 100755 --- a/.buildkite/commands/process-screenshots.sh +++ b/.buildkite/commands/process-screenshots.sh @@ -33,21 +33,26 @@ bundle exec fastlane create_screenshot_summary echo "--- :information_source: Check Font Availability" cd .. # Check if Proxima Nova is available (should be included in macOS Sonoma and above) -if fc-list | grep -i "proxima" > /dev/null 2>&1; then +if system_profiler SPFontsDataType | grep -i "proxima" > /dev/null 2>&1; then echo "Proxima Nova font found" -elif system_profiler SPFontsDataType | grep -i "proxima" > /dev/null 2>&1; then - echo "Proxima Nova font found via system_profiler" else echo "Warning: Proxima Nova font not found - promo screenshots may not render correctly" + echo "Checking available fonts with 'nova' in name:" + system_profiler SPFontsDataType | grep -i "nova" | head -5 || echo "No fonts with 'nova' found" fi echo "--- :package: Setup Git LFS" cd .. # Make sure we're in the repo root -pwd +# 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 -git config --get-regex lfs || echo "No LFS config found" echo "--- :art: Generate Promo Screenshots" +# Re-setup gems in repo root +install_gems bundle exec fastlane create_promo_screenshots force:true echo "--- :arrow_up: Upload Final Screenshots" From 9768ce0979cd2b9ef1a41617dfb7a52d396548a0 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 12:54:11 -0400 Subject: [PATCH 27/44] GHA: try replacing AWS S3 storage with artifacts until we have more info about S3. --- .github/workflows/screenshots.yml | 60 ++++++++++++++++--------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 99c5d29f022..c8a677cf19c 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -5,9 +5,6 @@ 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: @@ -73,9 +70,10 @@ 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" @@ -102,14 +100,21 @@ jobs: 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 @@ -117,27 +122,26 @@ jobs: name: raw-screenshots path: fastlane/screenshots - - name: Install Promo Screenshot Fonts + - name: Setup Git LFS and Verify Fonts 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 + + # Verify Proxima Nova is available (should be in macOS 15) + if system_profiler SPFontsDataType | grep -i "proxima" > /dev/null 2>&1; then + echo "✅ Proxima Nova font found - ready for promo screenshots" + else + echo "⚠️ Proxima Nova font not found - promo screenshots may not render correctly" + echo "Available fonts with 'nova' in name:" + system_profiler SPFontsDataType | grep -i "nova" | head -5 || echo "No fonts with 'nova' found" + fi - 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 From 9eed1361196d2c976731c46955754558a3eaf7da Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 13:31:16 -0400 Subject: [PATCH 28/44] Buildkite: try fixing errors in process-screenshots. --- .buildkite/commands/process-screenshots.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.buildkite/commands/process-screenshots.sh b/.buildkite/commands/process-screenshots.sh index fb48783ef44..2b50f1b70f4 100755 --- a/.buildkite/commands/process-screenshots.sh +++ b/.buildkite/commands/process-screenshots.sh @@ -31,7 +31,6 @@ echo "--- :chart_with_upwards_trend: Generate Screenshot Summary" bundle exec fastlane create_screenshot_summary echo "--- :information_source: Check Font Availability" -cd .. # Check if Proxima Nova is available (should be included in macOS Sonoma and above) if system_profiler SPFontsDataType | grep -i "proxima" > /dev/null 2>&1; then echo "Proxima Nova font found" @@ -42,7 +41,7 @@ else fi echo "--- :package: Setup Git LFS" -cd .. # Make sure we're in the repo root +cd .. # Go back to repo root from fastlane directory # Install Git LFS if not available if ! command -v git-lfs &> /dev/null; then echo "Installing Git LFS..." @@ -51,8 +50,6 @@ fi git lfs install && git lfs fetch && git lfs pull echo "--- :art: Generate Promo Screenshots" -# Re-setup gems in repo root -install_gems bundle exec fastlane create_promo_screenshots force:true echo "--- :arrow_up: Upload Final Screenshots" From c941377d4a38d8131d9b2ebbea8b4476436bdeaf Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 13:39:44 -0400 Subject: [PATCH 29/44] GHA: try fixing `AztecEditor-iOS` syntax error guessing that it's from unspecified Xcode version. --- fastlane/Fastfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 2ac95dbbe18..4871823f850 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -956,6 +956,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 From 495d3ca6f4b359c42d4e79b7cedd4d2760018454 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 14:25:18 -0400 Subject: [PATCH 30/44] Fix missing `drawText` for both GHA and Buildkite. --- .buildkite/commands/process-screenshots.sh | 6 ++++++ .github/workflows/screenshots.yml | 1 + 2 files changed, 7 insertions(+) diff --git a/.buildkite/commands/process-screenshots.sh b/.buildkite/commands/process-screenshots.sh index 2b50f1b70f4..e0b80a1a247 100755 --- a/.buildkite/commands/process-screenshots.sh +++ b/.buildkite/commands/process-screenshots.sh @@ -11,6 +11,12 @@ if ! command -v magick &> /dev/null; then brew link imagemagick@7 --force fi +# Install drawText for promo screenshots +if ! command -v drawText &> /dev/null; then + echo "Installing drawText..." + brew install automattic/build-tools/drawText +fi + echo "--- :gem: Install Screenshot Gems" bundle install --with screenshots diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index c8a677cf19c..38f11e220af 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -87,6 +87,7 @@ 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 From 9ea46a52d0b8118f17359ceb9361cc23cd35980a Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 14:53:24 -0400 Subject: [PATCH 31/44] Try fixing missing Proxima Nova font by falling back to other system fonts. --- fastlane/appstoreres/assets/styles/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/appstoreres/assets/styles/style.css b/fastlane/appstoreres/assets/styles/style.css index 11dfbdf8bad..4f1489f9cde 100644 --- a/fastlane/appstoreres/assets/styles/style.css +++ b/fastlane/appstoreres/assets/styles/style.css @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e735d19705e55ffb60e6e763ac8a5d1af3de4ac92f882a518c11e8f9427f4e6c -size 117 +oid sha256:16cc48b670d57a624dee8b2bc6beb3acc43acc34603facf18184179892607b9a +size 186 From 14c7a7c5e144a43ef432dd017541636311a2618a Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 15:16:11 -0400 Subject: [PATCH 32/44] Still getting font not available error without falling back to other fonts in Buildkite at least. Try using Helvetica Neue which is more likely to exist. --- fastlane/appstoreres/assets/styles/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/appstoreres/assets/styles/style.css b/fastlane/appstoreres/assets/styles/style.css index 4f1489f9cde..2f10c9d0c6a 100644 --- a/fastlane/appstoreres/assets/styles/style.css +++ b/fastlane/appstoreres/assets/styles/style.css @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:16cc48b670d57a624dee8b2bc6beb3acc43acc34603facf18184179892607b9a -size 186 +oid sha256:966283968877a05397b0e34b57c3a0b9d299dcf9f62aa4638b2bb23a0aa539ba +size 170 From d7d8a5ffa858e909076eb3f0b8b8b39f7fb448c0 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 15:54:48 -0400 Subject: [PATCH 33/44] GHA: enable light mode for promo screenshots. --- .github/workflows/screenshots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 38f11e220af..0db2fc9cb1d 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -41,7 +41,7 @@ jobs: strategy: matrix: language: [en-US] - mode: [dark] + mode: [dark, light] steps: - uses: actions/checkout@v4 - name: "Set up Ruby" From c7b8073ea9270a66085ee59c6d70dce6fdcd2a46 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 15:55:56 -0400 Subject: [PATCH 34/44] Buildkite: enable light mode for promo screenshots. --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 35f399ce2ca..49c0a1395ed 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -53,7 +53,7 @@ steps: # - zh-Hant mode: - dark - # - light + - light artifact_paths: - "fastlane/logs/**/*" notify: From ab3944aaf4316140069076715e874b3d75d306fa Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 16:51:03 -0400 Subject: [PATCH 35/44] Revert Buildkite changes now that GHA is working (without the custom font). --- .buildkite/commands/build-screenshots.sh | 26 --- .buildkite/commands/process-screenshots.sh | 63 ----- .buildkite/commands/take-screenshots.sh | 38 --- .buildkite/pipeline.yml | 259 ++++++++------------- .buildkite/screenshots-pipeline.yml | 87 ------- 5 files changed, 95 insertions(+), 378 deletions(-) delete mode 100755 .buildkite/commands/build-screenshots.sh delete mode 100755 .buildkite/commands/process-screenshots.sh delete mode 100755 .buildkite/commands/take-screenshots.sh delete mode 100644 .buildkite/screenshots-pipeline.yml diff --git a/.buildkite/commands/build-screenshots.sh b/.buildkite/commands/build-screenshots.sh deleted file mode 100755 index c5ea3e58592..00000000000 --- a/.buildkite/commands/build-screenshots.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -eu - -if .buildkite/commands/should-skip-job.sh --job-type build; then - exit 0 -fi - -echo "--- :rubygems: Setting up Gems" -install_gems - -echo "--- :swift: Setting up Swift Packages" -install_swiftpm_dependencies - -echo "--- :writing_hand: Copy Files" -mkdir -pv ~/.configure/woocommerce-ios/secrets -cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/project.env - -echo "--- :hammer_and_wrench: Building Screenshots App" -bundle exec fastlane build_screenshots - -echo "--- :arrow_up: Upload Screenshot App Artifacts" -# Create a structured archive of all build products (apps, frameworks, etc.) -tar -cf screenshot-artifacts.tar \ - -C fastlane/DerivedData/Build/Products/Debug-iphonesimulator \ - . - -buildkite-agent artifact upload screenshot-artifacts.tar \ No newline at end of file diff --git a/.buildkite/commands/process-screenshots.sh b/.buildkite/commands/process-screenshots.sh deleted file mode 100755 index e0b80a1a247..00000000000 --- a/.buildkite/commands/process-screenshots.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -eu - -echo "--- :rubygems: Setting up Gems" -install_gems - -echo "--- :apple: Install Native Dependencies" -# Install ImageMagick for screenshot processing -if ! command -v magick &> /dev/null; then - echo "Installing ImageMagick..." - brew install imagemagick@7 - brew link imagemagick@7 --force -fi - -# Install drawText for promo screenshots -if ! command -v drawText &> /dev/null; then - echo "Installing drawText..." - brew install automattic/build-tools/drawText -fi - -echo "--- :gem: Install Screenshot Gems" -bundle install --with screenshots - -echo "--- :writing_hand: Copy Files" -mkdir -pv ~/.configure/woocommerce-ios/secrets -cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/project.env - -echo "--- :gear: Setup Fastlane Dependencies" -bundle exec fastlane run configure_apply - -echo "--- :arrow_down: Download Generated Screenshots from CI Artifacts" -cd fastlane -mkdir -p screenshots -# Download all screenshot artifacts from the take-screenshots jobs -buildkite-agent artifact download "fastlane/screenshots-*/**/*" . --step "generate-screenshots" - -echo "--- :chart_with_upwards_trend: Generate Screenshot Summary" -bundle exec fastlane create_screenshot_summary - -echo "--- :information_source: Check Font Availability" -# Check if Proxima Nova is available (should be included in macOS Sonoma and above) -if system_profiler SPFontsDataType | grep -i "proxima" > /dev/null 2>&1; then - echo "Proxima Nova font found" -else - echo "Warning: Proxima Nova font not found - promo screenshots may not render correctly" - echo "Checking available fonts with 'nova' in name:" - system_profiler SPFontsDataType | grep -i "nova" | head -5 || echo "No fonts with 'nova' found" -fi - -echo "--- :package: Setup Git LFS" -cd .. # Go back to repo root from fastlane directory -# 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 - -echo "--- :art: Generate Promo Screenshots" -bundle exec fastlane create_promo_screenshots force:true - -echo "--- :arrow_up: Upload Final Screenshots" -buildkite-agent artifact upload "fastlane/screenshots/**/*" -buildkite-agent artifact upload "fastlane/promo_screenshots/**/*" \ No newline at end of file diff --git a/.buildkite/commands/take-screenshots.sh b/.buildkite/commands/take-screenshots.sh deleted file mode 100755 index 2e09f5f73d5..00000000000 --- a/.buildkite/commands/take-screenshots.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -eu - -# Get matrix values from command arguments -SCREENSHOT_LANGUAGE="${1:-en-US}" -SCREENSHOT_MODE="${2:-light}" - -echo "--- :rubygems: Setting up Gems" -install_gems - -echo "--- :writing_hand: Copy Files" -mkdir -pv ~/.configure/woocommerce-ios/secrets -cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/project.env - -echo "--- :arrow_down: Download Screenshot App Artifacts" -buildkite-agent artifact download screenshot-artifacts.tar . --job "build-screenshots" -mkdir -p fastlane/DerivedData/Build/Products/Debug-iphonesimulator/ -tar -xf screenshot-artifacts.tar -C fastlane/DerivedData/Build/Products/Debug-iphonesimulator/ - -echo "--- :gear: Setup Fastlane Dependencies" -bundle exec fastlane run configure_apply - -echo "--- :information_source: Screenshot Configuration" -echo "SCREENSHOT_LANGUAGE: '${SCREENSHOT_LANGUAGE}'" -echo "SCREENSHOT_MODE: '${SCREENSHOT_MODE}'" - -echo "--- :camera: Generate Screenshots for ${SCREENSHOT_LANGUAGE} (${SCREENSHOT_MODE} mode)" -bundle exec fastlane take_screenshots \ - languages:"${SCREENSHOT_LANGUAGE}" \ - mode:"${SCREENSHOT_MODE}" - -echo "--- :arrow_up: Upload Screenshots as CI Artifacts" -# Create unique directory for this job's screenshots -SCREENSHOT_DIR="fastlane/screenshots-${SCREENSHOT_LANGUAGE}-${SCREENSHOT_MODE}" -if [ -d "fastlane/screenshots" ]; then - mv fastlane/screenshots "${SCREENSHOT_DIR}" - # Upload as Buildkite artifacts for later processing - buildkite-agent artifact upload "${SCREENSHOT_DIR}/**/*" --job "${BUILDKITE_JOB_ID}" -fi \ No newline at end of file diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 49c0a1395ed..c8267aadf8f 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -6,189 +6,120 @@ agents: env: IMAGE_ID: $IMAGE_ID - CONFIGURE_ENCRYPTION_KEY: $CONFIGURE_ENCRYPTION_KEY -# TEMPORARY: Screenshots pipeline only - other jobs commented out +# This is the default pipeline – it will build and test the app steps: ################# - # Build Screenshots App + # Build the app ################# - - label: ":hammer_and_wrench: Build Screenshots App" - key: build-screenshots - command: .buildkite/commands/build-screenshots.sh + - label: ":pipeline: Build" + key: build + command: .buildkite/commands/build-for-testing.sh plugins: [$CI_TOOLKIT] - # if: build.pull_request.labels includes "generate screenshots" notify: - github_commit_status: - context: Build Screenshots App + context: Build ################# - # Generate Screenshots (Matrix) + # Create Prototype Build ################# - - label: ":camera: Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" - key: generate-screenshots - command: .buildkite/commands/take-screenshots.sh "{{matrix.language}}" "{{matrix.mode}}" - depends_on: build-screenshots + - label: ":hammer_and_wrench: Prototype Build" + command: .buildkite/commands/prototype-build.sh + plugins: [$CI_TOOLKIT] + if: build.pull_request.id != null + notify: + - github_commit_status: + context: Prototype Build + + ################# + # Run Unit Tests + ################# + - label: ":microscope: Unit Tests" + command: .buildkite/commands/run-unit-tests.sh + depends_on: build + plugins: [$CI_TOOLKIT] + artifact_paths: + - fastlane/test_output/* + notify: + - github_commit_status: + context: Unit Tests + + - label: ":microscope: Standalone WordPressAuthenticator Unit Tests" + command: .buildkite/commands/run-wordpress-authenticator-tests.sh plugins: [$CI_TOOLKIT] - if: build.pull_request.labels includes "generate screenshots" - matrix: - setup: - 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 - mode: - - dark - - light artifact_paths: - - "fastlane/logs/**/*" + - fastlane/test_output/* notify: - github_commit_status: - context: "Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" + context: WordPressAuthenticator Unit Tests ################# - # Process Screenshots + # Linters ################# - - label: ":framed_picture: Process Screenshots" - command: .buildkite/commands/process-screenshots.sh - depends_on: generate-screenshots + - group: Linters + steps: + - label: ":radioactive_sign: Danger - PR Check" + command: danger + key: danger + if: build.pull_request.id != null + retry: + manual: + permit_on_passed: true + agents: + queue: linter + notify: + - github_commit_status: + context: Danger - PR Check + + - label: ":swift: SwiftLint" + command: swiftlint + notify: + - github_commit_status: + context: SwiftLint + agents: + queue: linter + + - label: 🧹 Lint Translations + command: gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot + plugins: + - docker#v3.8.0: + image: public.ecr.aws/automattic/glotpress-validator:1.0.0 + agents: + queue: default + notify: + - github_commit_status: + context: Lint Translations + + - label: ":sleuth_or_spy: Lint Localized Strings Format" + command: .buildkite/commands/lint-localized-strings-format.sh + plugins: [$CI_TOOLKIT] + notify: + - github_commit_status: + context: Lint Localized Strings Format + + ################# + # UI Tests + ################# + - label: ":microscope: UI Tests (iPhone)" + command: .buildkite/commands/run-ui-tests.sh UITests "iPhone 16" + depends_on: build + # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 + if: build.branch == "trunk" || build.branch =~ /^release\// plugins: [$CI_TOOLKIT] - if: build.pull_request.labels includes "generate screenshots" artifact_paths: - - "fastlane/screenshots/**/*" - - "fastlane/promo_screenshots/**/*" + - fastlane/test_output/* notify: - github_commit_status: - context: Process Screenshots + context: UI Tests (iPhone) -# COMMENTED OUT - Original pipeline jobs -# Uncomment these when screenshots testing is complete -# -# ################# -# # Build the app -# ################# -# - label: ":pipeline: Build" -# key: build -# command: .buildkite/commands/build-for-testing.sh -# plugins: [$CI_TOOLKIT] -# notify: -# - github_commit_status: -# context: Build -# -# ################# -# # Create Prototype Build -# ################# -# - label: ":hammer_and_wrench: Prototype Build" -# command: .buildkite/commands/prototype-build.sh -# plugins: [$CI_TOOLKIT] -# if: build.pull_request.id != null -# notify: -# - github_commit_status: -# context: Prototype Build -# -# ################# -# # Run Unit Tests -# ################# -# - label: ":microscope: Unit Tests" -# command: .buildkite/commands/run-unit-tests.sh -# depends_on: build -# plugins: [$CI_TOOLKIT] -# artifact_paths: -# - fastlane/test_output/* -# notify: -# - github_commit_status: -# context: Unit Tests -# -# - label: ":microscope: Standalone WordPressAuthenticator Unit Tests" -# command: .buildkite/commands/run-wordpress-authenticator-tests.sh -# plugins: [$CI_TOOLKIT] -# artifact_paths: -# - fastlane/test_output/* -# notify: -# - github_commit_status: -# context: WordPressAuthenticator Unit Tests -# -# ################# -# # Linters -# ################# -# - group: Linters -# steps: -# - label: ":radioactive_sign: Danger - PR Check" -# command: danger -# key: danger -# if: build.pull_request.id != null -# retry: -# manual: -# permit_on_passed: true -# agents: -# queue: linter -# notify: -# - github_commit_status: -# context: Danger - PR Check -# -# - label: ":swift: SwiftLint" -# command: swiftlint -# notify: -# - github_commit_status: -# context: SwiftLint -# agents: -# queue: linter -# -# - label: 🧹 Lint Translations -# command: gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot -# plugins: -# - docker#v3.8.0: -# image: public.ecr.aws/automattic/glotpress-validator:1.0.0 -# agents: -# queue: default -# notify: -# - github_commit_status: -# context: Lint Translations -# -# - label: ":sleuth_or_spy: Lint Localized Strings Format" -# command: .buildkite/commands/lint-localized-strings-format.sh -# plugins: [$CI_TOOLKIT] -# notify: -# - github_commit_status: -# context: Lint Localized Strings Format -# -# ################# -# # UI Tests -# ################# -# - label: ":microscope: UI Tests (iPhone)" -# command: .buildkite/commands/run-ui-tests.sh UITests "iPhone 16" -# depends_on: build -# # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 -# if: build.branch == "trunk" || build.branch =~ /^release\// -# plugins: [$CI_TOOLKIT] -# artifact_paths: -# - fastlane/test_output/* -# notify: -# - github_commit_status: -# context: UI Tests (iPhone) -# -# - label: ":microscope: UI Tests (iPad)" -# command: .buildkite/commands/run-ui-tests.sh UITests "iPad Pro 13-inch (M4)" -# depends_on: build -# # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 -# if: build.branch == "trunk" || build.branch =~ /^release\// -# plugins: [$CI_TOOLKIT] -# artifact_paths: -# - fastlane/test_output/* -# notify: -# - github_commit_status: -# context: UI Tests (iPad) + - label: ":microscope: UI Tests (iPad)" + command: .buildkite/commands/run-ui-tests.sh UITests "iPad Pro 13-inch (M4)" + depends_on: build + # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 + if: build.branch == "trunk" || build.branch =~ /^release\// + plugins: [$CI_TOOLKIT] + artifact_paths: + - fastlane/test_output/* + notify: + - github_commit_status: + context: UI Tests (iPad) diff --git a/.buildkite/screenshots-pipeline.yml b/.buildkite/screenshots-pipeline.yml deleted file mode 100644 index 06547c768ea..00000000000 --- a/.buildkite/screenshots-pipeline.yml +++ /dev/null @@ -1,87 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json ---- - -agents: - queue: mac - -env: - IMAGE_ID: $IMAGE_ID - S3_BUCKET: $S3_BUCKET - AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY - CONFIGURE_ENCRYPTION_KEY: $CONFIGURE_ENCRYPTION_KEY - -# Screenshots pipeline - triggered by PR label "generate screenshots" -steps: - ################# - # Build Screenshots App - ################# - - label: ":hammer_and_wrench: Build Screenshots App" - key: build-screenshots - command: .buildkite/commands/build-screenshots.sh - plugins: [$CI_TOOLKIT] - if: build.pull_request.labels includes "generate screenshots" - artifact_paths: - - "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerce.app/**/*" - - "fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerceScreenshots-Runner.app/**/*" - - "screenshot-artifacts.tar" - notify: - - github_commit_status: - context: Build Screenshots App - - ################# - # Generate Screenshots (Matrix) - ################# - - label: ":camera: Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" - command: .buildkite/commands/take-screenshots.sh - depends_on: build-screenshots - plugins: [$CI_TOOLKIT] - if: build.pull_request.labels includes "generate screenshots" - matrix: - setup: - 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 - mode: - - dark - - light - env: - SCREENSHOT_LANGUAGE: "{{matrix.language}}" - SCREENSHOT_MODE: "{{matrix.mode}}" - artifact_paths: - - "fastlane/logs/**/*" - notify: - - github_commit_status: - context: "Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" - - ################# - # Process Screenshots - ################# - - label: ":framed_picture: Process Screenshots" - command: .buildkite/commands/process-screenshots.sh - depends_on: - - step: ":camera: Generate Screenshots ({{matrix.language}} - {{matrix.mode}})" - allow_failure: false - plugins: [$CI_TOOLKIT] - if: build.pull_request.labels includes "generate screenshots" - artifact_paths: - - "fastlane/screenshots/**/*" - - "fastlane/promo_screenshots/**/*" - notify: - - github_commit_status: - context: Process Screenshots \ No newline at end of file From df09ae648487c00964e70fe348e05e757e282ade Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 16:52:00 -0400 Subject: [PATCH 36/44] [WIP] Disable pipelines for now to save CI resources. --- .buildkite/pipeline.yml | 204 ++++++++++++++++++++-------------------- 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index c8267aadf8f..8b36452b8c4 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -12,114 +12,114 @@ steps: ################# # Build the app ################# - - label: ":pipeline: Build" - key: build - command: .buildkite/commands/build-for-testing.sh - plugins: [$CI_TOOLKIT] - notify: - - github_commit_status: - context: Build + # - label: ":pipeline: Build" + # key: build + # command: .buildkite/commands/build-for-testing.sh + # plugins: [$CI_TOOLKIT] + # notify: + # - github_commit_status: + # context: Build - ################# - # Create Prototype Build - ################# - - label: ":hammer_and_wrench: Prototype Build" - command: .buildkite/commands/prototype-build.sh - plugins: [$CI_TOOLKIT] - if: build.pull_request.id != null - notify: - - github_commit_status: - context: Prototype Build + # ################# + # # Create Prototype Build + # ################# + # - label: ":hammer_and_wrench: Prototype Build" + # command: .buildkite/commands/prototype-build.sh + # plugins: [$CI_TOOLKIT] + # if: build.pull_request.id != null + # notify: + # - github_commit_status: + # context: Prototype Build - ################# - # Run Unit Tests - ################# - - label: ":microscope: Unit Tests" - command: .buildkite/commands/run-unit-tests.sh - depends_on: build - plugins: [$CI_TOOLKIT] - artifact_paths: - - fastlane/test_output/* - notify: - - github_commit_status: - context: Unit Tests + # ################# + # # Run Unit Tests + # ################# + # - label: ":microscope: Unit Tests" + # command: .buildkite/commands/run-unit-tests.sh + # depends_on: build + # plugins: [$CI_TOOLKIT] + # artifact_paths: + # - fastlane/test_output/* + # notify: + # - github_commit_status: + # context: Unit Tests - - label: ":microscope: Standalone WordPressAuthenticator Unit Tests" - command: .buildkite/commands/run-wordpress-authenticator-tests.sh - plugins: [$CI_TOOLKIT] - artifact_paths: - - fastlane/test_output/* - notify: - - github_commit_status: - context: WordPressAuthenticator Unit Tests + # - label: ":microscope: Standalone WordPressAuthenticator Unit Tests" + # command: .buildkite/commands/run-wordpress-authenticator-tests.sh + # plugins: [$CI_TOOLKIT] + # artifact_paths: + # - fastlane/test_output/* + # notify: + # - github_commit_status: + # context: WordPressAuthenticator Unit Tests - ################# - # Linters - ################# - - group: Linters - steps: - - label: ":radioactive_sign: Danger - PR Check" - command: danger - key: danger - if: build.pull_request.id != null - retry: - manual: - permit_on_passed: true - agents: - queue: linter - notify: - - github_commit_status: - context: Danger - PR Check + # ################# + # # Linters + # ################# + # - group: Linters + # steps: + # - label: ":radioactive_sign: Danger - PR Check" + # command: danger + # key: danger + # if: build.pull_request.id != null + # retry: + # manual: + # permit_on_passed: true + # agents: + # queue: linter + # notify: + # - github_commit_status: + # context: Danger - PR Check - - label: ":swift: SwiftLint" - command: swiftlint - notify: - - github_commit_status: - context: SwiftLint - agents: - queue: linter + # - label: ":swift: SwiftLint" + # command: swiftlint + # notify: + # - github_commit_status: + # context: SwiftLint + # agents: + # queue: linter - - label: 🧹 Lint Translations - command: gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot - plugins: - - docker#v3.8.0: - image: public.ecr.aws/automattic/glotpress-validator:1.0.0 - agents: - queue: default - notify: - - github_commit_status: - context: Lint Translations + # - label: 🧹 Lint Translations + # command: gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot + # plugins: + # - docker#v3.8.0: + # image: public.ecr.aws/automattic/glotpress-validator:1.0.0 + # agents: + # queue: default + # notify: + # - github_commit_status: + # context: Lint Translations - - label: ":sleuth_or_spy: Lint Localized Strings Format" - command: .buildkite/commands/lint-localized-strings-format.sh - plugins: [$CI_TOOLKIT] - notify: - - github_commit_status: - context: Lint Localized Strings Format + # - label: ":sleuth_or_spy: Lint Localized Strings Format" + # command: .buildkite/commands/lint-localized-strings-format.sh + # plugins: [$CI_TOOLKIT] + # notify: + # - github_commit_status: + # context: Lint Localized Strings Format - ################# - # UI Tests - ################# - - label: ":microscope: UI Tests (iPhone)" - command: .buildkite/commands/run-ui-tests.sh UITests "iPhone 16" - depends_on: build - # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 - if: build.branch == "trunk" || build.branch =~ /^release\// - plugins: [$CI_TOOLKIT] - artifact_paths: - - fastlane/test_output/* - notify: - - github_commit_status: - context: UI Tests (iPhone) + # ################# + # # UI Tests + # ################# + # - label: ":microscope: UI Tests (iPhone)" + # command: .buildkite/commands/run-ui-tests.sh UITests "iPhone 16" + # depends_on: build + # # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 + # if: build.branch == "trunk" || build.branch =~ /^release\// + # plugins: [$CI_TOOLKIT] + # artifact_paths: + # - fastlane/test_output/* + # notify: + # - github_commit_status: + # context: UI Tests (iPhone) - - label: ":microscope: UI Tests (iPad)" - command: .buildkite/commands/run-ui-tests.sh UITests "iPad Pro 13-inch (M4)" - depends_on: build - # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 - if: build.branch == "trunk" || build.branch =~ /^release\// - plugins: [$CI_TOOLKIT] - artifact_paths: - - fastlane/test_output/* - notify: - - github_commit_status: - context: UI Tests (iPad) + # - label: ":microscope: UI Tests (iPad)" + # command: .buildkite/commands/run-ui-tests.sh UITests "iPad Pro 13-inch (M4)" + # depends_on: build + # # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 + # if: build.branch == "trunk" || build.branch =~ /^release\// + # plugins: [$CI_TOOLKIT] + # artifact_paths: + # - fastlane/test_output/* + # notify: + # - github_commit_status: + # context: UI Tests (iPad) From aca0843fcb568815047db967a70f5bc17fa9b7ff Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 26 Jun 2025 16:55:37 -0400 Subject: [PATCH 37/44] Enable one more locale ineligible for POS tab. --- .github/workflows/screenshots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 0db2fc9cb1d..544831dc3d3 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -40,7 +40,7 @@ jobs: strategy: matrix: - language: [en-US] + language: [en-US, zh-Hant] mode: [dark, light] steps: - uses: actions/checkout@v4 From dfa74a882ee4decfe5a5d00dcb18d25127980860 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Fri, 27 Jun 2025 08:14:57 -0400 Subject: [PATCH 38/44] Just specify one font name since the fallback did not work with the `drawText` tool. --- fastlane/appstoreres/assets/styles/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/appstoreres/assets/styles/style.css b/fastlane/appstoreres/assets/styles/style.css index 2f10c9d0c6a..aa775f8cb22 100644 --- a/fastlane/appstoreres/assets/styles/style.css +++ b/fastlane/appstoreres/assets/styles/style.css @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:966283968877a05397b0e34b57c3a0b9d299dcf9f62aa4638b2bb23a0aa539ba -size 170 +oid sha256:cd963a43692886a4edc57064be504e75526b1b9aa95581442c95d4ca39ced154 +size 121 From 580a40f197821d7dc5b6b86d34fe084f07f95118 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Fri, 27 Jun 2025 08:21:32 -0400 Subject: [PATCH 39/44] Remove Proxima Nova font now that we are using Helvetica Neue that is available in CI macOS images. --- .github/workflows/screenshots.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 544831dc3d3..9e8e2e71576 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -123,7 +123,7 @@ jobs: name: raw-screenshots path: fastlane/screenshots - - name: Setup Git LFS and Verify Fonts + - name: Setup Git LFS run: | # Install Git LFS if not available if ! command -v git-lfs &> /dev/null; then @@ -131,15 +131,6 @@ jobs: brew install git-lfs fi git lfs install && git lfs fetch && git lfs pull - - # Verify Proxima Nova is available (should be in macOS 15) - if system_profiler SPFontsDataType | grep -i "proxima" > /dev/null 2>&1; then - echo "✅ Proxima Nova font found - ready for promo screenshots" - else - echo "⚠️ Proxima Nova font not found - promo screenshots may not render correctly" - echo "Available fonts with 'nova' in name:" - system_profiler SPFontsDataType | grep -i "nova" | head -5 || echo "No fonts with 'nova' found" - fi - name: Generate Promo Screenshots run: | From f90287c828fbaeb993de903df5e6e35082b46217 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Fri, 27 Jun 2025 08:22:48 -0400 Subject: [PATCH 40/44] Re-enable all locales to measure the time and ensure promo screenshots look good for all locales. --- .github/workflows/screenshots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 9e8e2e71576..39abb41fe23 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -40,7 +40,7 @@ jobs: strategy: matrix: - language: [en-US, zh-Hant] + 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] mode: [dark, light] steps: - uses: actions/checkout@v4 From 602c99c47079fe3fb608b5458b28c27ff573fb00 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Fri, 27 Jun 2025 09:01:09 -0400 Subject: [PATCH 41/44] Try fixing `ar` issue by matching IOS_LOCALES in Fastfile. --- .github/workflows/screenshots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 39abb41fe23..f1901e621b4 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -40,7 +40,7 @@ jobs: 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 From 172b47026d493128f13b9e9ff6949b4f15886561 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Fri, 27 Jun 2025 14:06:06 -0400 Subject: [PATCH 42/44] Uncomment tasks pipeline steps. --- .buildkite/pipeline.yml | 204 ++++++++++++++++++++-------------------- 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 8b36452b8c4..c8267aadf8f 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -12,114 +12,114 @@ steps: ################# # Build the app ################# - # - label: ":pipeline: Build" - # key: build - # command: .buildkite/commands/build-for-testing.sh - # plugins: [$CI_TOOLKIT] - # notify: - # - github_commit_status: - # context: Build + - label: ":pipeline: Build" + key: build + command: .buildkite/commands/build-for-testing.sh + plugins: [$CI_TOOLKIT] + notify: + - github_commit_status: + context: Build - # ################# - # # Create Prototype Build - # ################# - # - label: ":hammer_and_wrench: Prototype Build" - # command: .buildkite/commands/prototype-build.sh - # plugins: [$CI_TOOLKIT] - # if: build.pull_request.id != null - # notify: - # - github_commit_status: - # context: Prototype Build + ################# + # Create Prototype Build + ################# + - label: ":hammer_and_wrench: Prototype Build" + command: .buildkite/commands/prototype-build.sh + plugins: [$CI_TOOLKIT] + if: build.pull_request.id != null + notify: + - github_commit_status: + context: Prototype Build - # ################# - # # Run Unit Tests - # ################# - # - label: ":microscope: Unit Tests" - # command: .buildkite/commands/run-unit-tests.sh - # depends_on: build - # plugins: [$CI_TOOLKIT] - # artifact_paths: - # - fastlane/test_output/* - # notify: - # - github_commit_status: - # context: Unit Tests + ################# + # Run Unit Tests + ################# + - label: ":microscope: Unit Tests" + command: .buildkite/commands/run-unit-tests.sh + depends_on: build + plugins: [$CI_TOOLKIT] + artifact_paths: + - fastlane/test_output/* + notify: + - github_commit_status: + context: Unit Tests - # - label: ":microscope: Standalone WordPressAuthenticator Unit Tests" - # command: .buildkite/commands/run-wordpress-authenticator-tests.sh - # plugins: [$CI_TOOLKIT] - # artifact_paths: - # - fastlane/test_output/* - # notify: - # - github_commit_status: - # context: WordPressAuthenticator Unit Tests + - label: ":microscope: Standalone WordPressAuthenticator Unit Tests" + command: .buildkite/commands/run-wordpress-authenticator-tests.sh + plugins: [$CI_TOOLKIT] + artifact_paths: + - fastlane/test_output/* + notify: + - github_commit_status: + context: WordPressAuthenticator Unit Tests - # ################# - # # Linters - # ################# - # - group: Linters - # steps: - # - label: ":radioactive_sign: Danger - PR Check" - # command: danger - # key: danger - # if: build.pull_request.id != null - # retry: - # manual: - # permit_on_passed: true - # agents: - # queue: linter - # notify: - # - github_commit_status: - # context: Danger - PR Check + ################# + # Linters + ################# + - group: Linters + steps: + - label: ":radioactive_sign: Danger - PR Check" + command: danger + key: danger + if: build.pull_request.id != null + retry: + manual: + permit_on_passed: true + agents: + queue: linter + notify: + - github_commit_status: + context: Danger - PR Check - # - label: ":swift: SwiftLint" - # command: swiftlint - # notify: - # - github_commit_status: - # context: SwiftLint - # agents: - # queue: linter + - label: ":swift: SwiftLint" + command: swiftlint + notify: + - github_commit_status: + context: SwiftLint + agents: + queue: linter - # - label: 🧹 Lint Translations - # command: gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot - # plugins: - # - docker#v3.8.0: - # image: public.ecr.aws/automattic/glotpress-validator:1.0.0 - # agents: - # queue: default - # notify: - # - github_commit_status: - # context: Lint Translations + - label: 🧹 Lint Translations + command: gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot + plugins: + - docker#v3.8.0: + image: public.ecr.aws/automattic/glotpress-validator:1.0.0 + agents: + queue: default + notify: + - github_commit_status: + context: Lint Translations - # - label: ":sleuth_or_spy: Lint Localized Strings Format" - # command: .buildkite/commands/lint-localized-strings-format.sh - # plugins: [$CI_TOOLKIT] - # notify: - # - github_commit_status: - # context: Lint Localized Strings Format + - label: ":sleuth_or_spy: Lint Localized Strings Format" + command: .buildkite/commands/lint-localized-strings-format.sh + plugins: [$CI_TOOLKIT] + notify: + - github_commit_status: + context: Lint Localized Strings Format - # ################# - # # UI Tests - # ################# - # - label: ":microscope: UI Tests (iPhone)" - # command: .buildkite/commands/run-ui-tests.sh UITests "iPhone 16" - # depends_on: build - # # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 - # if: build.branch == "trunk" || build.branch =~ /^release\// - # plugins: [$CI_TOOLKIT] - # artifact_paths: - # - fastlane/test_output/* - # notify: - # - github_commit_status: - # context: UI Tests (iPhone) + ################# + # UI Tests + ################# + - label: ":microscope: UI Tests (iPhone)" + command: .buildkite/commands/run-ui-tests.sh UITests "iPhone 16" + depends_on: build + # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 + if: build.branch == "trunk" || build.branch =~ /^release\// + plugins: [$CI_TOOLKIT] + artifact_paths: + - fastlane/test_output/* + notify: + - github_commit_status: + context: UI Tests (iPhone) - # - label: ":microscope: UI Tests (iPad)" - # command: .buildkite/commands/run-ui-tests.sh UITests "iPad Pro 13-inch (M4)" - # depends_on: build - # # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 - # if: build.branch == "trunk" || build.branch =~ /^release\// - # plugins: [$CI_TOOLKIT] - # artifact_paths: - # - fastlane/test_output/* - # notify: - # - github_commit_status: - # context: UI Tests (iPad) + - label: ":microscope: UI Tests (iPad)" + command: .buildkite/commands/run-ui-tests.sh UITests "iPad Pro 13-inch (M4)" + depends_on: build + # Only run on `trunk` and `release/*` -- See p91TBi-cBM-p2#comment-13736 + if: build.branch == "trunk" || build.branch =~ /^release\// + plugins: [$CI_TOOLKIT] + artifact_paths: + - fastlane/test_output/* + notify: + - github_commit_status: + context: UI Tests (iPad) From 6f118d2d2161bfd915f305ed7d54b7da9c246bc4 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Fri, 18 Jul 2025 16:08:45 -0400 Subject: [PATCH 43/44] Try addressing suggestion to remove the `Install Screenshot Gems` step and use an env var at the job level instead. https://github.com/woocommerce/woocommerce-ios/pull/15822/files#r2178045214 --- .github/workflows/screenshots.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index f1901e621b4..7f67cb2ab8d 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -80,6 +80,9 @@ jobs: needs: capture runs-on: macos-15 + env: + BUNDLE_WITH: screenshots + steps: - uses: actions/checkout@v4 @@ -94,9 +97,6 @@ jobs: with: bundler-cache: true - - name: Install Screenshot Gems - run: bundle install --with screenshots - - name: Install Fastlane Dependencies run: bundle exec fastlane run configure_apply From f02111c8e87d7a95c9b0d44c7213b471a210d5b9 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Fri, 18 Jul 2025 16:10:55 -0400 Subject: [PATCH 44/44] Make build files discardable after 1 day as they are only used for the workflow. --- .github/workflows/screenshots.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 7f67cb2ab8d..d4e9a6fe160 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -32,6 +32,7 @@ jobs: with: name: screenshot-build-products path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/ + retention-days: 1 capture: name: Capture