Repository navigation
ci: fail PRs whose Package.resolved is out of date - #940
Merged
Merged
Conversation
Xcode Cloud resolves from the committed workspace Package.resolved and won't update it, so a stale pin fails every deploy while local Xcode re-resolves silently. The flipcash2 0.14.x bump broke Deploy Flipcash this way. Resolve with -disableAutomaticPackageResolution, which applies the same restriction, on PRs that touch a Package.swift, Package.resolved, or the project file.
A workflow-level paths filter leaves PRs that don't match waiting on a required check that never reports. Move the filter into a cheap ubuntu job and skip the macOS resolve job when no package file changed; GitHub counts a job skipped by its if: as passing.
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.
Adds a check that runs
xcodebuild -resolvePackageDependencies -disableAutomaticPackageResolution, the same restriction Xcode Cloud resolves under. The flipcash2 0.14.x bump broke Deploy Flipcash for this reason (fixed in #938):Package.swiftmoved toexact: 0.14.1,Package.resolvedstayed on 0.12.0, and local Xcode re-resolved without anyone noticing.Against
main's stale file it fails in about 40s, before cloning anything, with the same "out-of-date resolved file" error Xcode Cloud hits. Against #938's file it passes and leaves the file unchanged. A second step runsgit diff --exit-codeon the file in case resolution succeeds but rewrites a pin.It runs on every PR so it can be a required check: a cheap ubuntu job checks whether a
Package.swift, aPackage.resolved,project.pbxproj, or the workflow itself changed, and the macOS resolve job is skipped (which GitHub counts as passing) when none did. A workflow-levelpaths:filter would leave unrelated PRs waiting on a check that never reports.