Skip to content

Add multi-version matrix support to Wasm Swift SDK workflow - #3575

Merged
Lukasa merged 6 commits into
apple:mainfrom
inductor:wasm-multi-version-matrix
Apr 21, 2026
Merged

Lukasa merged 6 commits into
apple:mainfrom
inductor:wasm-multi-version-matrix

Conversation

@inductor

@inductor inductor commented Apr 13, 2026 •

Copy link
Copy Markdown
Member

Add multi-version matrix support to Wasm Swift SDK workflow

Motivation:

The WASM CI only ran against nightly-main, making it impossible to distinguish toolchain regressions from code issues. Other repos in the ecosystem using swiftlang/github-workflows already test against nightly-main, nightly-6.3, and 6.3 by default.

Modifications:

  • Add nightly_main_enabled, nightly_6_3_enabled, and release_6_3_enabled boolean inputs to wasm_swift_sdk.yml (all defaulting to true, matching the coverage of swiftlang/github-workflows/swift_package_test.yml) and update the matrix generation to emit the appropriate entry per enabled version.
  • Update install_swift_sdk.sh to support non-main branch snapshots by deriving the API and download paths from INSTALL_SWIFT_BRANCH rather than hardcoding main/development.
  • Fail early with a clear message if the branch snapshot API returns no results, rather than hitting an unbound variable error.

Result:

WASM builds are now tested against multiple Swift versions, providing a stable baseline to identify nightly-only regressions. Callers using the workflow without arguments get the new default coverage automatically; those who want to narrow the matrix can set specific version inputs to false.

Motivation:
The WASM CI only ran against nightly-main, making it impossible to
distinguish toolchain regressions from code issues. Other repos in
the ecosystem using swiftlang/github-workflows already test against
nightly-main, nightly-6.3, and 6.3 by default.

Modifications:
- Add a `swift_versions` input to `wasm_swift_sdk.yml` (default:
  `["nightly-main", "nightly-6.3", "6.3"]`, matching
  swiftlang/github-workflows/swift_package_test.yml) and update the
  matrix generation to iterate over versions, mapping `nightly-X.Y`
  to the corresponding branch snapshot and `X.Y` to the release
  toolchain.
- Validate `swift_versions` is a non-empty string array with entries
  matching `nightly-X`, `nightly-X.Y`, or `X.Y` format.
- Update `install_swift_sdk.sh` to support non-main branch snapshots
  by deriving the API and download paths from `INSTALL_SWIFT_BRANCH`
  rather than hardcoding `main`/`development`.
- Fail early with a clear message if the branch snapshot API returns
  no results, rather than hitting an unbound variable error.

Result:
WASM builds are now tested against multiple Swift versions, providing
a stable baseline to identify nightly-only regressions.
@inductor inductor changed the title Add multi-version matrix support to WASM Swift SDK workflow Add multi-version matrix support to Wasm Swift SDK workflow Apr 13, 2026
Comment thread .github/workflows/wasm_swift_sdk.yml Outdated
swift_versions:
type: string
description: "Swift version list (JSON). Use 'nightly-main', 'nightly-X.Y' for branch snapshots, or 'X.Y' for releases."
default: '["nightly-main", "nightly-6.3", "6.3"]'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment the idiomatic way to enable/disable Swift versions in the NIO workflows is to have a parameter which enables/disables specific versions:

linux_6_3_enabled:

linux_nightly_next_enabled:

### Motivation:

The previous implementation used a `swift_versions` JSON array input,
which is not idiomatic for NIO workflows. The reviewer pointed out that
the standard pattern in this repository is to use individual boolean
inputs to enable/disable specific versions (as seen in unit_tests.yml).

### Modifications:

Replace the `swift_versions` JSON array input with three individual
boolean inputs: `nightly_main_enabled`, `nightly_6_3_enabled`, and
`release_6_3_enabled`, each defaulting to true.

### Result:

The workflow input API now matches the idiomatic NIO pattern used across
other workflows in this repository.
Comment thread .github/workflows/wasm_swift_sdk.yml Resolved
Comment thread .github/workflows/wasm_swift_sdk.yml Outdated
fi

if [[ "$INPUT_NIGHTLY_NEXT_ENABLED" == "true" ]]; then
entry=$(make_entry "nightly-6.3" "INSTALL_SWIFT_BRANCH=swift-6.3-branch")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there, can you move this next -> 6.3 mapping out of the body of this code somehow? In an env var might be nicest because then it's very clear how you would update it.

@inductor
inductor requested a review from rnro April 16, 2026 00:13
@inductor inductor added semver/none No version bump required. github_actions Pull requests that update GitHub Actions code labels Apr 17, 2026
@Lukasa
Lukasa enabled auto-merge (squash) April 21, 2026 14:40
@Lukasa
Lukasa merged commit 32e3d86 into apple:main Apr 21, 2026
49 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants