Repository navigation
Use the CI toolkit's Swift package cache, and name the test simulator once - #26298
Merged
Merged
Conversation
…simulator once The local swiftpm-cache.sh and swiftpm-artifacts-cache.sh scripts move to the a8c-ci-toolkit as restore_swiftpm_cache and save_swiftpm_cache, with the same cache keys. The test lanes read the deployment target from Common.xcconfig, and build and test on the iPhone 18 Pro used by the rest of the repo.
On the CI image the unit tests take about 50 s longer on the iPhone 18 Pro, mostly while the test bundles launch.
jkmassel
force-pushed
the
jkmassel/faster-ci-setup-v1
branch
from
October 30, 2026 00:39
607be3b to
f84907e
Compare
mokagio
reviewed
Oct 30, 2026
| APP="${1:?Usage: build-and-upload-testflight.sh <wordpress|jetpack|reader>}" | ||
|
|
||
| "$(dirname "${BASH_SOURCE[0]}")/shared-set-up.sh" | ||
| # The build-for-testing jobs save the Swift Package binaries cache, so it's only restored here |
Contributor
There was a problem hiding this comment.
I'd remove the comment from here.
Suggested change
| # The build-for-testing jobs save the Swift Package binaries cache, so it's only restored here |
If we want to mention that we don't need to save the cache, which makes sense, we could move it where the save call ought to be.
mokagio
reviewed
Oct 30, 2026
| "$(dirname "${BASH_SOURCE[0]}")/swiftpm-artifacts-cache.sh" restore DerivedData/SourcePackages Modules/Package.resolved | ||
|
|
||
| echo "--- :testflight: Building and uploading ${APP} to TestFlight" | ||
| bundle exec fastlane build_and_upload_app_for_testflight app:"${APP}" |
Contributor
There was a problem hiding this comment.
Suggested change
| bundle exec fastlane build_and_upload_app_for_testflight app:"${APP}" | |
| bundle exec fastlane build_and_upload_app_for_testflight app:"${APP}" | |
| # No call to save the Swift cache here. | |
| # The build-for-testing jobs already did that and here it was only restored. |
mokagio
approved these changes
Oct 30, 2026
16 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #26286 that applies its three review suggestions, with no loss of CI performance. The new cache commands come from Automattic/a8c-ci-toolkit-buildkite-plugin#239, released in 7.1.0.
Changes
restore_swiftpm_cacheandsave_swiftpm_cachereplaceswiftpm-cache.shandswiftpm-artifacts-cache.sh, using the same cache keys, so existing cache entries still hit. The toolkit'sinstall_swiftpm_dependenciescouldn't be used as it stands:Package.resolvedinside the workspace. Ours isModules/Package.resolved.CI_SIMULATOR_DEVICEin the Fastfile replaces the three hard-coded names in the CI lanes.Config/Common.xcconfig(AINFRA-3528), using the existingXcconfigHelper. It parses the file, so it doesn't bring back thexcodebuild -showBuildSettingscall that Cut PR CI time by a third: resolve Swift packages once and cache binary frameworks #26286 removed.git-concealcommands, and this repo uses neither. 7.1.0 adds the cache commands.One small behaviour change: Swift Package Tests now keys its shared SwiftPM cache on the root
Package.resolved, which is the fileswift testresolves. It used to restore the app's cache and never saved one.Why the CI simulator stays the iPhone 17 Pro
The first run used
iPhone 18 Pro, as suggested. That made Unit Tests about 50 s slower in every run: 5:15 against 4:25, the mean of 3 paired runs. The other jobs didn't change. The time goes into launching the test bundles:So the CI lanes keep the 17 Pro, with the reason in a comment. The local
testlane still defaults to the 18 Pro. Switching CI over needs the CI image to have the 18 Pro ready, and that's a separate change.Results
We ran 3 builds of this branch and 3 trunk control builds at the same time. Each control is trunk's tree plus a comment in
shared-pipeline-vars. These runs used the #239 commit before release; the only changes in 7.1.0 since then are comments. The figures are means of job durations. Wall clock isn't compared, because 7 builds shared the Mac queue and jobs waited up to 18 minutes for an agent.The Unit Tests runs ranged from 4:04 to 4:24 on both sides, so the 5 s difference is noise.
Test plan
Restoring cache entry wordpress-ios-spm-cache-551d37…andwordpress-ios-spm-artifacts-v1-551d37…, the keys trunk already saved.bundle exec fastlane lanesloads, andXcconfigHelperreads17.0fromCommon.xcconfig.rubocopis clean.trunk, so they first run after merge. They use the sameshared-set-up.sh --artifactspath as the build-for-testing jobs.