Skip to content

Conversation

rnro
Copy link
Contributor

@rnro rnro commented Oct 21, 2025

Don't generate matrix jobs for Swift versions which aren't supported by the package.

Motivation:

Matrix workflows should not generate jobs for Swift versions < tools version, doing so wastes compute and adds noise.

This means that:

  • New repos don’t need to manually opt-out of old Swift versions
  • Repos which have dropped an old Swift version (during a migration window) won’t have failing tests until it’s turned off centrally.

Modifications:

(This is probably best reviewed as two separate commits)

  • The generate script now looks for Package.swift and Package@swift-*.swift files and uses the lowest tools version in any found file to determine the minimum supported Swift version
  • Any Swift version lower than the minimum is disregarded and no jobs are generated for it
  • A new parameter is added to the workflows which allows the minimum Swift version to be set manually (minimum_swift_version)

Result:

By default in this and downstream packages we don't generate matrix jobs for Swift versions which aren't supported by the package.

An example of this working: https://github.com/apple/swift-nio/actions/runs/18711362977/job/53360387720?pr=3415

@MahdiBM
Copy link
Contributor

MahdiBM commented Oct 21, 2025

Just linking to our own swift-and-macos-version compatibility checking action in Vapor just in case it can be helpful:
https://github.com/vapor/ci/blob/main/.github/actions/check-compatible-swift/action.yml

@rnro rnro force-pushed the skip_unsupported_swift_versions branch from d7f56e8 to 8300571 Compare October 21, 2025 14:57
@rnro
Copy link
Contributor Author

rnro commented Oct 21, 2025

Thanks @MahdiBM, that was useful to check against. I like the use of the swift package utilities to check the versions itself but I don't think we can do that because we aren't executing the check inside the Docker container so the installed swift version doesn't match the target.

@rnro rnro force-pushed the skip_unsupported_swift_versions branch 2 times, most recently from 860ada9 to fb44b0c Compare October 22, 2025 09:13
@rnro rnro force-pushed the skip_unsupported_swift_versions branch from fb44b0c to a508077 Compare October 22, 2025 09:14
This reverts commit a508077.
@rnro rnro added 🆕 semver/minor Adds new public API. semver/none No version bump required. and removed 🆕 semver/minor Adds new public API. labels Oct 22, 2025
@rnro rnro marked this pull request as ready for review October 22, 2025 09:23
@rnro rnro changed the title skip unsupported swift versions Don't generate matrix jobs for Swift versions which aren't supported by the package. Oct 22, 2025
@rnro rnro merged commit 843c8cf into main Oct 22, 2025
61 of 65 checks passed
@rnro rnro deleted the skip_unsupported_swift_versions branch October 22, 2025 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants