CI: Optimize builds and cancel in flight builds#768
Merged
Conversation
We want to cancel in progress jobs since we dont really need them; just always run on the latest pushed code immediately, freeing up resources more eagerly
Drop Swift 6.2 from Linux jobs and reduce macOS jobs to Swift 6.3 only. verify-samples is now 6.3 only on both platforms since the 7-sample fan-out was the largest contributor (was 28 Linux + 14 macOS = 42 jobs; now 7 + 7 = 14). Linux still covers 6.1.3 and nightly via test-swift. Saves ~32 jobs per PR.
Collaborator
Author
|
Trying to improve caching to speed up the samples builds as well |
Each Samples/<name>/Package.swift declares swift-java as a path: "../../" dependency, so every sample's `swift build` recompiles the entire swift-java tree (including swift-syntax) into its own .build dir. With seven samples this is ~7x duplicated work and dominates CI time. Add an actions/cache step to verify-samples and verify-samples-macos that caches Samples/<sample>/.build keyed on swift-java sources + sample sources + Swift toolchain version, with restore-keys so partial reuse kicks in even when swift-java sources change. SwiftPM's incremental build then rebuilds only what actually changed. The bigger structural win (re-enabling --experimental-prebuilts to skip swift-syntax entirely) is still blocked on swiftlang#418 and tracked separately.
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.
We have too many builds now, because we test every sample and on many platforms and swift versions. This is too extreme since they don't really differ much.
We want to cancel in progress jobs since we dont really need them; just always run on the latest pushed code immediately, freeing up resources more eagerly
We also improve build caching for the samples