Motivation
* External callers of `macos_benchmarks.yml` (e.g. swift-log) currently invoke the reusable workflow once per benchmark package, paying self-hosted macOS runner-recycling cost for each invocation.
* There was no way to consolidate multiple packages into a single workflow call.
Modifications
* Add a new `benchmark_package_paths` input to `.github/workflows/macos_benchmarks.yml` and mark the singular `benchmark_package_path` as deprecated. The run step forwards both inputs straight to the script via `BENCHMARK_PACKAGE_PATH` and `BENCHMARK_PACKAGE_PATHS` environment variables; the workflow itself does no path parsing.
* Teach `scripts/check_benchmark_thresholds.sh` to accept `BENCHMARK_PACKAGE_PATHS` as either a JSON array of strings (auto-detected by a leading `[`, requires `jq`) or a newline-separated list, falling back to the legacy `BENCHMARK_PACKAGE_PATH` when unset or when the JSON form is an empty array.
* The script now loops over the resolved package list, wraps each iteration in a GitHub Actions `::group::`, and emits an `::error::` summary listing failed packages at the end, exiting non-zero if any failed.
Result
* A single workflow invocation runs all listed packages serially on each Swift/Xcode runner, paying runner-recycling cost once per Swift version instead of once per (version x package).
* Existing single-package callers keep working unchanged.
* Adopters of the script in other contexts (e.g. the Linux `benchmarks.yml`) can pick up multi-package support by passing `BENCHMARK_PACKAGE_PATHS` without reimplementing parsing or failure-collection logic.
### Motivation
* The versioned `linux_nightly_6_1_enabled` input was deprecated a while
back in favour of `linux_nightly_next_enabled`, but the workflows still
combined the two with `||`/`&&` to keep the old name working.
* Now that callers have migrated, the shim is unnecessary complexity.
### Modifications
* In `unit_tests.yml`, `cxx_interop.yml`, and `benchmarks.yml`, replace
`inputs.linux_nightly_6_1_enabled || inputs.linux_nightly_next_enabled`
(and the `&&` variants) with just `inputs.linux_nightly_next_enabled`.
### Result
* `MATRIX_LINUX_NIGHTLY_NEXT_ENABLED` is driven solely by
`linux_nightly_next_enabled`.
### Motivation
* Xcode 15.4, 16.0, 16.1, 16.2, and 26 beta were already deprecated
and defaulted to `false` with no callers enabling them — redundant code.
* Xcode 16.3, 16.4, 26.0, and 26.1 will soon be uninstalled from the
runners. Their inputs are kept so downstream callers don't break, but
they should no longer produce any matrix entries.
### Modifications
* Remove input declarations, shell variables, matrix construction
blocks, and environment variable mappings for 15.4/16.0/16.1/16.2/26
beta entirely.
* Remove the matrix logic for 16.3/16.4/26.0/26.1 but retain the input
declarations as no-ops, with descriptions communicating they have no
effect.
### Result
* Less dead code in the shared workflow.
* Callers still passing `xcode_16_3` through `xcode_26_1` inputs get no
error but also no job — a graceful no-op while they migrate to
`swift_*` inputs.
### Motivation
* The `swift_*` inputs request Xcodes by Swift version with symlinks on
the runners owning the mapping. This more directly expresses the
library support window.
* All callers should migrate to `swift_6_1/6_2/6_3_enabled` instead of
specifying Xcode versions directly.
### Modifications
* Default `xcode_16_3/16_4/26_0/26_1/26_2_enabled` to `false` and mark
their descriptions as deprecated.
* Default `swift_6_1/6_2/6_3_enabled` to `true`.
### Result
* Repos still passing `xcode_*_enabled: true` explicitly continue to
work until they migrate.
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`.
---------
Co-authored-by: Rick Newton-Rogers <rnro@apple.com>
Co-authored-by: Cory Benfield <lukasa@apple.com>
### Motivation:
A recent PR (#3574) added support for customising the container
environment used for the matrix job for users of the reusable workflow.
It supported a custom Dockerfile and controlling `--cap-add` options to
the `docker run` command. Users who require this fine-grained control
with `--cap-add` also will benefit from being able to control the
`--security-opt` of the `docker run` command.
### Modifications:
- Add support for `--security-opt` docker flags in custom CI jobs
### Result:
Users of the reusable matrix CI workflow can control the
`--security-opt` for the container.
### Motivation
* Some consumers need to run CI inside custom Docker images with
additional Linux capabilities. The shared matrix workflows had no way to
express this — consumers had to maintain entirely bespoke CI workflows
instead.
### Modifications
* Added `MATRIX_LINUX_DOCKERFILE` and
`MATRIX_LINUX_DOCKER_CAPABILITIES_JSON` environment variables to
`generate_matrix.sh`. These propagate as `dockerfile` (string) and
`docker_capabilities` (JSON array) fields in the matrix JSON. Defaults
are empty/`[]` so existing callers are unaffected.
* Extended `add_matrix_entry()` with two optional trailing parameters
for the new fields.
* In `swift_test_matrix.yml`:
- Made the "Pull Docker image" step conditional — skipped when a
`dockerfile` is provided.
- Added a "Build Docker image from Dockerfile" step that builds the
image with `--build-arg SWIFT_IMAGE=<matrix image>` so consumers can
parameterise the Swift base image.
- Added `--cap-add` flags to `docker run` when `docker_capabilities` is
non-empty.
### Result
* Consumers can set `MATRIX_LINUX_DOCKERFILE` to a repo-relative path
and `MATRIX_LINUX_DOCKER_CAPABILITIES_JSON` to a JSON array of
capabilities. The matrix will build their Dockerfile per Swift version
and run containers with the requested capabilities.
* Existing consumers that don't set these variables see no change.
Motivation:
Swift 6.0 is no longer supported, we should bump the tools version and
remove it from our CI.
Modifications:
* Bump the Swift tools version to Swift 6.1
* Remove Swift 6.0 jobs where appropriate in main.yml, pull_request.yml
* Set language mode 5 in Benchmarks package manifest
Result:
Code reflects our support window.
---------
Co-authored-by: George Barnett <gbarnett@apple.com>
Fix Windows Docker daemon not starting before polling
### Motivation:
When a Windows runner is restored from a saved VM image, the Docker
service sometimes fails to start during the "second boot" due to a
failure creating the required virtual switches.
Manually restarting the Docker service resolves the issue every time.
### Modifications:
Before polling `docker info`, check whether the Docker service is
running and start it if it is not.
### Result:
The Docker daemon becomes available reliably on Windows runners.
### Motivation
* Swift 6.3 has been released, we should add it to our CI coverage.
### Modifications
* Update `apple/swift-nio/scripts/generate_matrix.sh`
* Update `apple/swift-nio/scripts/check-matrix-job.sh`
* Update reusable adopters of `swift_test_matrix.yml`
* Update end-user adopter workflows of `swift_test_matrix.yml`
* Remove stale `NIGHTLY_6_1` fallback shims from `generate_matrix.sh`
* Migrate `linux_nightly_6_1_arguments_override` to
`linux_nightly_next_arguments_override` in `main.yml` and
`pull_request.yml`
* Copy benchmark thresholds from 6.2
### Result
* NIO tests against Swift 6.3 in CI and downstream repositories can
opt-in.
* A successful run using the new Swift 6.3 jobs:
https://github.com/apple/swift-nio/actions/runs/23841350537/job/69497505715?pr=3565
Increase job timeout for macOS tests from 30 to 60 minutes.
### Motivation:
We see test jobs getting cancelled, for example:
https://github.com/apple/swift-nio/actions/runs/23240305356
### Modifications:
Increase test time.
### Result:
Test jobs will complete.
Add Swift-version-based inputs to macOS CI workflows
### Motivation
- The macOS CI runners now provide symbolic links mapping Swift versions
to Xcode apps ( `Xcode_swift_6.1.app`, `Xcode_swift_6.2.app`,
`Xcode_swift_6.3.app`), decoupling CI from specific Xcode versions.
- Several Xcode versions (`16.3`, `26.0`, `26.1`, `26.2`) are being
deprecated and removed from runners.
- The `-require-explicit-sendable` build argument overrides on Xcode
16.2/16.3 are no longer needed.
### Modifications
- Added `swift_6_1_enabled`, `swift_6_2_enabled`, `swift_6_3_enabled`
inputs (with corresponding `build_arguments_override`,
`test_arguments_override`, setup_command) to `macos_tests.yml`, all
defaulting to false.
- Added macos_ `swift_6_1_enabled`, macos_ `swift_6_2_enabled`, macos_
`swift_6_3_enabled` inputs to `macos_benchmarks.yml`.
- Added matrix entries using the `Xcode_swift_6.X.app` symlink paths.
- All existing `xcode_*` inputs remain unchanged for backwards
compatibility with downstream consumers.
- Enabled the new Swift-version inputs in main.yml and pull_request.yml,
removing the old `xcode_16_2/16_3` build argument overrides.
### Result
- SwiftNIO CI now runs macOS jobs for Swift `6.1`, `6.2`, and `6.3`
using the stable `Xcode_swift_6.X.app` symlinks.
- Downstream consumers are unaffected.
An example of this working here
https://github.com/apple/swift-nio/actions/runs/22960228328/job/66648462048?pr=3546
### Motivation
* xcodebuild output is suppressed with `-quiet` in the macOS tests
workflow, making it hard to diagnose CI failures on the main branch.
### Modifications
* Add a `debug_output_enabled` boolean input to `macos_tests.yml`
(defaults to `false`), which controls a `QUIET_ARG` env var used by all
xcodebuild invocations.
* When `debug_output_enabled` is `true`, `-quiet` is elided and full
xcodebuild output is emitted.
* Enable `debug_output_enabled` in `main.yml` so nightly and main-branch
push builds produce verbose output.
### Result
* PR builds remain concise (default behaviour unchanged).
* Main-branch builds now include full xcodebuild output for easier
failure triage.
Shut down simulators between test runs
### Motivation:
I suspect the CI machines are underpowered and we see simulator load
failures during testing because we are running out of resources.
### Modifications:
Add a command to shutdown the simulators before running each simulator
test.
### Result:
Hopefully, tests will pass more reliably.
### Motivation
* Swift 5.10 is no longer actively supported and CI does not require it
### Modifications
* Default Swift 5.10 CI jobs to disabled
### Result
* Swift 5.10 CI jobs will not run unless opted-in
Add parallel execution mode for integration tests
### Motivation:
Integration tests regularly take 21m in CI; they're the long pole.
### Modifications:
* Allocation count tests are now run in parallel if
`NIO_ALLOC_COUNTER_TESTS_PARALLEL` is `true`, tests in a given file
are still in serial.
* Test output is catted to different files and recovered and printed in
the order in which the tests were started.
### Result:
Integration test execution (and therefore a PR's CI checks) goes from
21m to 10m
Motivation
* `@main` references to `swiftlang/github-workflows` are deprecated.
Modifications
* Replace `@main` with `@0.0.7` in all workflow files.
Result
* Workflow files reference a pinned version of
`swiftlang/github-workflows`.
Sequoia runners are no longer available and we need to switch to Tahoe.
### Motivation:
Sequoia runners are no longer available and jobs requesting them hang.
### Modifications:
Request Tahoe runners.
### Result:
Jobs no longer hang, macOS tests and benchmarks are running on Tahoe.
Xcode-latest currently points to the 26.1 release so it gives us a false
sense of version coverage, and should be ignored.
### Motivation:
We do not need to build twice with the same environment.
### Modifications:
Set default value for Xcode latest beta enabled to `false`
### Result:
One fewer job generated for the macOS build matrix.
Co-authored-by: Rick Newton-Rogers <rnro@apple.com>
Instead of evaluating inputs directly in the run step, save them to an
environment variable and evaluate that.
### Motivation:
Evaluating workflow inputs directly can lead to injection attacks, such
as those described at https://docs.zizmor.sh/audits/#template-injection
### Modifications:
Evaluate workflow inputs as environment variables so that they do not
inadvertently execute arbitrary shell injections.
### Result:
The workflows should be more secure against malicious inputs.
Limit Darwin Job execution to apple org.
### Motivation:
When the repo is forked, the forks do not have access to the self-hosted
CI, so it should not block actions in the forked environment.
### Modifications:
Conditionalize Darwin job execution.
### Result:
macOS CI will not queue on forks.
Extract macOS benchmarks into a separate reusable workflow to completely
remove them if they are not meant to be used.
### Motivation:
macOS Benchmarks is an opt-in workflow. If no macOS versions selected to
run benchmarks on, there is now a skipped matrix jobs, creating
unnecessary visual and cognitive noise during workflow results analysis:
<img width="391" height="369" alt="Screenshot 2025-12-10 at 14 22 50"
src="https://github.com/user-attachments/assets/959ff2a1-3872-4bff-97ac-1dca6d2d4ea5"
/>
### Modifications:
macOS benchmarks workflow is extracted into a separate reusable
workflow.
### Result:
- If a repo is not running macOS benchmarks, there is no extra skipped
jobs.
- When willing to run macOS benchmarks, `macos_benchmarks.yml` workflow
should be used.
- This is a breaking change in the reusable workflows interface, so all
the repos (just the `swift-log`?) need to adopt the new reusable
workflow.
Test runs:
- old workflow run with [unused macOS benchmarks skipped and
visible](https://github.com/apple/swift-nio/actions/runs/20102000384/job/57675171794)
- new workflow run with [no macOS benchmarks
visible](https://github.com/apple/swift-nio/actions/runs/20102837431)
because they are not used
- new workflow run with actually [executed and visible macOS
benchmarks](https://github.com/apple/swift-nio/actions/runs/20103726421)
After the recent addition of macOS-based benchmarks, the `main` workflow
has been failing with:
```
Error when evaluating 'strategy' for job 'benchmarks-macos'. apple/swift-nio/.github/workflows/benchmarks.yml@main (Line: 239, Col: 15): Matrix vector 'config' does not contain any values
```
This happens because `swift-nio` does not set any `_enabled` flag for
any version of Xcode to run the benchmarks.
An example of a failed run:
https://github.com/apple/swift-nio/actions/runs/19479529118
### Motivation:
Scheduled jobs should not fail.
### Modifications:
Added a condition for running macOS benchmarks matrix generation job.
### Result:
Jobs should not fail without any Xcode versions picked for running
benchmarks.
An example of a run with macos-matrix job skipped:
https://github.com/apple/swift-nio/actions/runs/19482328681/job/55758816398
An example of a run with a opt-in macOS Benchmarks:
https://github.com/apple/swift-nio/actions/runs/19484086327/job/55762298924
Run benchmarks on macOS in addition to Linux.
### Motivation:
1. macOS and Linux benchmark yield different results and we would like
to rack both of them.
2. default Linux GitHub workers do not provide access to PMU, which is
necessary for instructions metric benchmarking
### Modifications:
- `benchmarks.yml` workflow support running benchmarks on self-hosted
macOS runners
### Result:
Benchmarks are running on both linux and macOS runners. An example of an
opt-in PR running just one Xcode version:
https://github.com/apple/swift-nio/actions/runs/19468002318/job/55707591945.
An example of an opt-in PR and thresholds expectations check failed:
https://github.com/apple/swift-nio/actions/runs/19468236909/job/55708359111
I've been running `swift-nio` benchmarks on macOS runners and it is much
less stable than Linux for allocations and context switches. I suggest
we make this an opt-in feature and take in only for instructions count
benchmarks, for example upcoming to the `swift-log`. This also makes it
less stressful for macOS runners pool.
### Motivation:
The Watch Series 10 and iPhone 16 Pro simulators haven't been working
for some time
### Modifications:
Swap the iOS and macOS test targets
### Result:
Testing against simulators should work
Here is an example of the change in action. The new targets can be
discovered but one of the Xcodes then hits an unrelated issue
https://github.com/apple/swift-nio/actions/runs/19130486127/job/54672071880?pr=3437
### Motivation:
Xcode 26.1 has been released so our support window slides forwards.
### Modifications:
* Add Xcode 26.1 job
* Log Xcode and swift versions for debugging purposes
### Result:
Current Xcode support window, easier debugging.
**NOTE:** we will soon disable Xcode 16.3 by default but will give
adopters time to update their PR status checks first
An example of this in action
https://github.com/apple/swift-nio/actions/runs/19129667587/job/54667112541?pr=3438
Swift SDK installation script improvements
### Motivation:
The SDK installation scripts had a few rough edges and didn't verify the
artefacts they downloaded.
### Modifications:
* Change naming to the more accurate "Swift SDK" where we can without
breaking downstream adopters.
* Separate Android NDK installation into its own script.
* Avoid using `cd` when setting up Android NDK.
* Verify checksums for SDKs and signatures for toolchains.
* Specify/control the SDK directory.
### Result:
* More accurate naming.
* More maintainable scripts.
* More secure downloads.
An example of this working
https://github.com/apple/swift-nio/actions/runs/18944235613/job/54090944716?pr=3429
"SDK" and "Swift SDK" are different concepts, compare `swift build
--help | grep sdk` output, where we have separate CLI options for these
with different meaning:
* SDK is used by Clang and Xcode, with Swift Driver also implementing
the `-sdk` flag. There's no specification for how Clang SDKs are
distributed, thus we don't distribute any Wasm SDK as such.
* Swift SDK is purely a SwiftPM feature, which uses artifact bundles for
distribution. We do distribute Swift SDKs for Wasm.
Same for static Linux BTW, so a separate PR is needed to clean up that
confusion for Musl-related CI workflows.
Additionally, Wasm is not an acronym. Per the Wasm spec
https://webassembly.github.io/spec/core/intro/introduction.html#wasm:
> A contraction of “WebAssembly”, not an acronym, hence not using
all-caps.
Fix env var support
### Motivation:
The new WASM and Android SDK workflows report an error in CI
```
jq: error (at <stdin>:1): string ("\"$env_var...) has no keys
```
### Modifications:
Construct the matrix separately and include the env var variable.
### Result:
No more issue in logs, env vars are applied
See this in action here:
https://github.com/apple/swift-nio/actions/runs/18719810714/job/53388814243?pr=3420
### Motivation:
Android SDKs now exist and testing is good.
### Modifications:
Add an Android GitHub Actions workflow using the latest nightly image
and enable it in NIO targetting NIOCore (matching WASM testing).
### Result:
More reusable workflows and more test coverage for NIO
See this in action here (the CI job works but NIOCore fails to build):
https://github.com/apple/swift-nio/actions/runs/18718487605/job/53384086329?pr=3418
WASM SDK GitHub Actions workflows use NIO matrix rather than the
swiftlang one
### Motivation:
Using the NIO one is more in line with the surrounding workflows and
surfaces a simpler UI (possible jobs which aren't run don't appear in
the UI)
### Modifications:
Pull in changes from https://github.com/apple/swift-nio/pull/3159 and
add in the ability to specify environment variables and other build
arguments in line with the static Linux SDK workflow.
### Result:
More regularity, simpler checks UI.
See this in action here:
https://github.com/apple/swift-nio/actions/runs/18717131164/job/53379323803?pr=3417
---------
Co-authored-by: Yuta Saito <kateinoigakukun@gmail.com>
Co-authored-by: Max Desiatov <m_desiatov@apple.com>
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:
- 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
26.1 Beta 2 has been released so we have an Xcode beta to be testing, we
should enable it by default again. It was previously disabled under the
impression that there was no current beta.