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.
Allow custom argument specification in the Static SDK workflow
### Motivation:
Sometimes users may want to specify more/different parameters such as
specifying building only some targets
### Modifications:
Add a parameter for the build arguments
### Result:
More flexible SDK CI.
You can see this in action here
https://github.com/apple/swift-nio/actions/runs/17858707940/job/50783709148?pr=3377
Allow the specification of custom environment variables in our matrix
workflow and those which use it.
### Motivation:
It can be useful to supply custom environment variables to control build
and runtime options.
### Modifications:
Allow users to supply a string of custom environment variable key-value
pairs which are supplied to the docker container running the matrix
commands.
To attempt to avoid issues with this string concatenation the change
also allows the user to specify custom list entry and key-value-pair
separators.
To avoid parameter bloat the env vars are set for all Swift versions,
hopefully that's sufficient for now.
### Result:
Adopters can
Examples of this working on Linux and Windows, note the presence of the
test environment variables I injected:
-
https://github.com/apple/swift-nio/actions/runs/17917619451/job/50943847555?pr=3376
- https://github.com/apple/swift-crypto/pull/413/checks
e.g.
```
Executing Docker command: docker run -v /home/runner/work/swift-nio/swift-nio:/swift-nio -w /swift-nio -e CI=true -e GITHUB_ACTIONS=true -e SWIFT_VERSION=6.0 -e workspace=/swift-nio -e TEST_DEBUG=1 -e TEST_LOG_LEVEL=info swift:6.0-jammy bash -c swift --version && swift test -Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error
```
### Motivation:
New Xcodes are out so we should test with them.
### Modifications:
Update the macOS matrix generation script
### Result:
Add Xcode 26.0, 16.4 CI, remove 16.2 jobs by default.
CI with the new Xcodes working (except 26.0 which will come online as
nodes recycle
https://github.com/apple/swift-nio/actions/runs/17834807139/job/50709176060?pr=3375)
Add build check CI for WebAssembly SDK
### Motivation:
Add build check CI for WebAssembly SDK
### Modifications:
Add Wasm build checks in `main.yml` and `pull_request.yml` based on
https://github.com/apple/swift-nio/pull/3331
Extracted from https://github.com/apple/swift-nio/pull/3159
### Result:
Setting up the CI job makes it easier to detect such incompatibility
before merging.
Add build check CI for WebAssembly SDK
### Motivation:
Add build check CI for WebAssembly SDK
### Modifications:
Add only reusable GHA workflow from
https://github.com/apple/swift-nio/pull/3159 to gracefully merge changes
without breaking CI.
After this change being merged into main branch, we can merge the actual
PR checks: https://github.com/apple/swift-nio/pull/3331
### Result:
Setting up the CI job makes it easier to detect such incompatibility
before merging.
Fixes all warnings when `-require-explicit-sendable` flag is enabled and
enables the flag on macOS CI.
### Motivation:
We want to ensure our public API is either explicitly marked as
`Sendable` or not.
### Modifications:
Marked appropriate public types as `Sendable`, or explicitly defined
their conformance to the `Sendable` protocol as unavailable.
### Result:
We can now enable `-require-explicit-sendable` compiler flag in our
codebase.
### Motivation:
Some errors do not show up in debug builds. Enabling release mode builds
improves the CI coverage.
### Modifications:
Enable release mode builds for pull requests and scheduled builds on
main.
### Result:
Improved CI coverage.
### Motivation:
Not everything that relies on these workflows builds on windows. Unit
tests and release builds should be explicitly enabled for windows
builds.
### Modifications:
Change default of windows nightly to false. Fix flag checks that enable
nightly builds.
### Result:
Easier to use CI workflows.
Add a new workflow file for release mode builds
### Motivation:
Some errors do not show up in debug builds. Running release mode builds
improves the CI coverage.
### Modifications:
Add a new workflow for release mode builds.
### Result:
Projects can build on this workflow to enable release mode builds.
Instead of checking for a setup command in bash, we use GitHub Actions
to determine if there is anything to run
### Motivation:
Slightly cleaner output when looking at logs.
### Modifications:
Moved an if statement from bash to yaml.
### Result:
The setup commands step will generally be skipped instead of executing a
no-op
Co-authored-by: Cory Benfield <lukasa@apple.com>
Motivation:
The nightly visionOS tests are failing because there
are too many simulators matching the given destination
selector.
Modifications:
- On Xcode 16.2 use visionOS 2.3
Result:
Nightly CI passes
Specify default macOS variant in non-catalyst builds.
https://developer.apple.com/forums/thread/737851
### Motivation:
macOS build has an extra warning:
```
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, name:Any Mac }
{ platform:macOS, variant:Mac Catalyst, name:Any Mac }
```
### Modifications:
Explicitly select the macOS variant.
### Result:
No warnings
### Motivation:
The macOS runners have a symlink to the latest released Xcode beta at
Xcode-latest.app, by making use of it we will always test against the
most recent version.
### Modifications:
Introduce new parameters for the latest Xcode beta and deprecate those
which mention Xcode 21 betas.
### Result:
Tests will move on to using Xcode 26 beta 2 via the symlink
Example of this working
https://github.com/apple/swift-nio/actions/runs/16075841548/job/45370760690?pr=3285
Fixed issue with macOS CI when overrides are being used.
### Motivation:
When we use Xcode_XX_X_build_arguments_override, the CI fails because of
an extra double quotes ("") making its way to the final command.
### Modifications:
Remove the extra double quote from the Yaml file defining macOS tests.
### Result:
We are able to run `swift build` with extra arguments.
Add Xcode 26 beta 1 to macOS CI and disable Xcode 16.1 jobs by default
### Motivation:
* Xcode 26 beta 1 is now released, we should test our code on it.
* We should drop 16.1 to conserve the number of jobs. 16.1 isn't
offering much coverage anyway since it has the same Swift minor version
(6.0) as Xcode 16.2.
### Modifications:
* Enable use of Xcode 26 beta 1 by default.
* Disable Xcode 16.1 jobs by default
### Result:
* This and downstream repos will run Xcode builds on Xcode 26 beta 1.
* Xcode 16.1 jobs won't run by default on this or downstream repos but
will run if explicitly requested.
An example of this working
https://github.com/apple/swift-nio/actions/runs/15614383580/job/43983277904?pr=3267
### Motivation:
The current method of parsing the ASCII table output is brittle and
because the text output and the stored thresholds in JSON have different
precisions doesn't always work.
### Modifications:
* In the event that a deviation is found re-run the benchmarks in update
mode and print the git diff to the logs.
* The threshold update script scrapes this from the logs and applies it
locally so that it can then be committed.
* Add the functionality in the update script to update thresholds based
on diff in logs
### Result:
More reliable threshold updates.
An example of this working:
https://github.com/apple/swift-nio/actions/runs/15302748893?pr=3257
---------
Co-authored-by: George Barnett <gbarnett@apple.com>
### Motivation:
Some 429: Too many requests responses have been seen when attempting to
curl remote CI scripts.
### Modifications:
Adding `--retry 3` which means that curl will retry 3 times on transient
error codes.
### Result:
Transient errors will be retried 3 times, first for 1 second and then
doubled each retry.
From `man curl`
```
--retry <num>
If a transient error is returned when curl tries to perform a transfer, it
retries this number of times before giving up. Setting the number to 0
makes curl do no retries (which is the default). Transient error means
either: a timeout, an FTP 4xx response code or an HTTP 408, 429, 500, 502,
503 or 504 response code.
When curl is about to retry a transfer, it first waits one second and then
for all forthcoming retries it doubles the waiting time until it reaches 10
minutes which then remains delay between the rest of the retries. By using
--retry-delay you disable this exponential backoff algorithm. See also
--retry-max-time to limit the total time allowed for retries.
curl complies with the Retry-After: response header if one was present to
know when to issue the next retry (added in 7.66.0).
If --retry is provided several times, the last set value is used.
```