Commit Graph

140 Commits

Author SHA1 Message Date
Rick Newton-Rogers af3eee91b9 Benchmark diffs not being output on threshold regression
Motivation

* `check_benchmark_thresholds.sh` was updated to check for exit code 2
from `swift package benchmark thresholds check` to distinguish
threshold regression from build errors.
* It seems SwiftPM's `CommandPlugin` infrastructure always exits with code 1 when
`performCommand` throws, regardless of the error's raw value. So the
exit code is never 2, causing all regressions to fall through to the
`else` branch and be misreported as build errors, with no diff output.

Modifications

* Remove the `rc == 2` check and instead attempt `thresholds update`
for any non-zero `rc` from `thresholds check`.
* Use the result of `thresholds update` to distinguish regression
(success) from build error (failure).
* Remove `--exit-code` from `git diff` to prevent `set -uo pipefail`
from aborting the script before output is fully flushed.

Result

* Benchmark threshold regressions correctly output the `=== BEGIN DIFF
===` section again.
* Actual build errors are still correctly detected and reported.
2026-02-20 15:30:18 +00:00
Fabian Fett 2fdda6c78e Fix benchmark succeeding – even though Benchmark build failed (#3502)
### Motivation:

Currently if there is an error in the Benchmark targets, that prevents
the Benchmark to build correctly, we still get a CI success.

### Modifications:

- Check for the threshold changed error

### Result:

- More reliable CI
2026-02-17 10:30:44 +00:00
Si Beaumont c329d1e173 Fix C++ interop CI script to work with changes in SwiftPM (#3510)
### Motivation:

SwiftPM behaviour has changed in recent Swift nightlies.

In most recent released version of Swift, SwiftPM will use the parent
directory name for the source and test target directory too, even when
it contains a period:

```
% docker run -it swift:6.2 bash -c 'mkdir -p /tmp/foo.bar && cd /tmp/foo.bar && swift package init'
Creating library package: foo.bar
Creating Package.swift
Creating .gitignore
Creating Sources
Creating Sources/foo.bar/foo_bar.swift
Creating Tests/
Creating Tests/foo.barTests/
Creating Tests/foo.barTests/foo_barTests.swift
```

Note in the above how it replaces the `.` with a `_` in the source
files, but the directories retain the `.`.

In the recent nightly-main, SwiftPM has also started replacing `.` with
`_` in the target directory names:

```
% docker run -it swiftlang/swift:nightly-main bash -c 'cat /etc/motd && mkdir -p /tmp/foo.bar && cd /tmp/foo.bar && swift package init'
################################################################
#                                                              #
# Swift Nightly Docker Image                                   #
# Tag: swift-DEVELOPMENT-SNAPSHOT-2026-02-06-a                 #
#                                                              #
################################################################
Creating library package: foo.bar
Creating Package.swift
Creating .gitignore
Creating Sources
Creating Sources/foo_bar/foo_bar.swift
Creating Tests/
Creating Tests/foo_barTests/
Creating Tests/foo_barTests/foo_barTests.swift
```

Probably this
https://github.com/swiftlang/swift-package-manager/pull/9252.

This breaks our CI automation, only on nightly-main, because we run
`swift package init` in a directory created by `mktemp -d`, which, by
default, follows the pattern `tmp.XXXXXXX`.

### Modifications:

Create temporary directory for Swift package using explicit pattern
containing no periods.

### Result:

C++ interop CI should now work again on nightly-main Swift, and continue
to work on all supported Swift versions.
2026-02-11 17:13:33 +00:00
Franz Busch 5e72fc1029 Move nightly-next CI to 6.3 (#3496)
This PR moves the nightly-next CI to use the 6.3 images. Since those
checks should be non required on any user of this package and the name
of the check doesn't change with moving images this should be a
non-breaking change.
2026-01-27 16:32:59 +01:00
Rick Newton-Rogers fa91d790ad Generate matrix nested manifests (#3431)
Generate matrix script finds manifests in subdirs

### Motivation:

The genereate matrix script attempts to derive the minimum Swift version
supported by the package so that it doesn't run CI on versions which are
older than that supported. At the moment it can't cope with repositories
with packages in subdirectories like swift-nio-examples.

### Modifications:

The script looks for manifests in subdirectories if
`FIND_SUBDIRECTORY_MANIFESTS_ENABLED=true`. This is opt-in because by
default CI only uses the top-level manifests.

### Result:

CI should generate more appropriate jobs.

An example of this in action
https://github.com/apple/swift-nio/actions/runs/18968739126/job/54171197381?pr=3431
2025-10-31 10:36:21 +00:00
Rick Newton-Rogers 3ed0975c29 Android use static swift stdlib (#3430)
android build use swift static stdlib

### Motivation:

Android build fails and the guide says to use this flag
https://www.swift.org/documentation/articles/swift-sdk-for-android-getting-started.html

Recent failure - although weirdly it doesn't seem to happen every time:
```
error: link command failed with exit code 1 (use -v to see invocation)
ld.lld: error: cannot open crtbegin_dynamic.o: No such file or directory
ld.lld: error: cannot open crtend_android.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[558/601] Linking NIOUDPEchoClient

```

### Modifications:

android build use swift static stdlib

### Result:

hopefully success - making this change locally seemed to work.

This change can be seen in action here
https://github.com/apple/swift-nio/actions/runs/18949279888/job/54110590743?pr=3430
2025-10-31 09:54:51 +00:00
Rick Newton-Rogers d373d41637 Swift SDK installation script improvements (#3429)
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
2025-10-30 17:50:17 +01:00
Marc Prud'hommeaux a24771a4c2 Fix the Android CI workflow by adding a post-install step the configure the SDK (#3424)
Fixes the Android CI workflow

### Motivation:

The recently-added Android SDK workflow
[fails](https://github.com/apple/swift-nio/actions/runs/18718487605/job/53384086329?pr=3418)
(as mentioned at
https://github.com/apple/swift-nio/pull/3418#issue-3540969388). The
confusing error message is due to a post-install step that is needed to
download and link the Android NDK into the Swift SDK's artifactbundle.

This PR also adds a one-line fix to
[Sources/NIOPerformanceTester/main.swift](https://github.com/apple/swift-nio/compare/main...swift-android-sdk:swift-nio:main#diff-de179adbbfacb89c9533f4efd21f7f641eedc0c8642d7d650cdfc9d9278a7a55)
that gets it building for Android so the entire swift-nio package can be
built.

### Modifications:

Adds a post-install step to the SDK installation that is needed for the
Swift SDK for Android. This is the same technique used by
https://github.com/swiftlang/github-workflows/pull/172, and is described
as a necessary step in the [Android getting started
guide](https://github.com/swiftlang/swift-org-website/blob/0dc655ce267e7b6bada2a2032cc7855c3b5e19d9/documentation/articles/swift-android-getting-started.md)

### Result:

The "Android Swift SDK" CI check should now pass successfully. See an
example at
https://github.com/swift-android-sdk/swift-nio/actions/runs/18761057590/job/53525442382

### Note:

This PR will _not_ pass the Android check until it has been merged,
because it relies on being able to down the the script
https://raw.githubusercontent.com/apple/swift-nio/main/scripts/install_swift_sdk.sh
from `apple/swift-nio/main`, which will not include the Android fix
until the PR is merged. But once it is merged, the Android SDK CI should
start passing.
2025-10-30 10:04:17 +00:00
Rick Newton-Rogers 412a870a93 Android SDK Workflow (#3418)
### 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
2025-10-22 15:00:34 +01:00
Rick Newton-Rogers e46b29f349 WASM SDK GitHub Actions workflows use NIO matrix (#3417)
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>
2025-10-22 14:22:24 +01:00
Rick Newton-Rogers 843c8cf264 Don't generate matrix jobs for Swift versions which aren't supported by the package. (#3415)
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
2025-10-22 11:40:01 +01:00
Rick Newton-Rogers 154706efd3 Matrix custom env vars (#3376)
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
```
2025-09-22 16:06:47 +01:00
Fabian Fett 6c114e3c62 Update CI scripts for 6.2 (#3374)
Replaces: #3373
2025-09-19 13:55:48 +01:00
Evan Wilde f9b58f26ca CMake Updater: Output difference in expectations (#3314)
Teach the script to indicate what is different on failure rather than
keeping quiet. This helps when the script is failing in CI but not
locally.

### Motivation:

The script is reporting that there are missing changes in CI on
swift-crypto, but I am unable to reproduce them locally. This is to get
immediate insight on why the check fails rather than keeping quiet.

### Modifications:

Include the diff in the update-cmake-lists script.

### Result:

update-cmake-lists script outputs the difference between what is in a PR
vs what it expects to see instead of shrugging and leaving it as an
exercise to the user.
2025-07-22 13:55:46 +00:00
Rick Newton-Rogers c39d34d0b7 Update generate_matrix.sh for windows nightlies to 2022 images (#3284)
Update generate_matrix.sh for windows nightlies to 2022 images as the
2019 images are retired
2025-07-04 09:25:53 +01:00
Fabrice de Gans f5339fbb21 Add assembly files for Windows (#3275)
Add assembly files for Windows

### Motivation:

These assembly files are now required to build on Windows Arm64.

### Modifications:

* The Windows assembly files are now handled in `update-cmake-lists.sh`.

### Result:

The assembly source files will be properly updated in `swift-crypto`.
2025-06-27 19:52:10 +00:00
Rick Newton-Rogers e3e1cb50ec Benchmarks workflow prints diff when changes found (#3258)
### 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>
2025-05-29 14:29:52 +00:00
Rick Newton-Rogers 355bc48edf Update the matrix nightly-next to point to 6.2 (#3250)
### Motivation:

Nightly builds for 6.2 exist, we should test against them.

### Modifications:

Update the matrix nightly-next to point to 6.2. This will affect
downstream adopters but shouldn't break them because they don't gatet
PRs on this passing.

### Result:

nightly tests will run against Swift 6.2

An example of this working
https://github.com/apple/swift-nio/actions/runs/15185876449/job/42706027686?pr=3250
2025-05-22 12:20:03 +00:00
Rick Newton-Rogers d53225264f Update check-matrix-job.sh to default swift commands (#3237)
Update check-matrix-job.sh to default swift commands so that callers
which don't define them can still run workflows. At the moment they see
failures if they don't define any one of the commands.
2025-05-13 11:31:54 +00:00
Rick Newton-Rogers c78bc87f8f Disable Swift 5.9 CI jobs by default (#3233)
### Motivation:

Swift 5.9 is no longer supported and CI has been updated to no longer
require it, we should disable it by default.

### Modifications:

* Default Swift 5.9 CI jobs to disabled

### Result:

Swift 5.9 CI jobs will not run unless opted-in
2025-05-08 08:37:40 +01:00
Rick Newton-Rogers c5cc43d1df Update matrix job script for 6.1 (#3201)
### Motivation:

The matrix job script used by the legacy Swift matrix workflow is still
used directly in some places where they need to run sidecar services, it
hasn't been updated for Swift 6.1

### Modifications:

Add cases for Swift 6.1 and clean up some missed changes for the
nightly-6.1 -> nightly-next naming change.

### Result:

Downstream services should be able to run matrix workflows with Swift
6.1.
2025-04-14 10:20:46 +00:00
Rick Newton-Rogers b8c446368d Add and enable Swift 6.1 workflows (#3196)
Add and enable Swift 6.1 workflows

### Motivation:

Swift 6.1 has been released, we should add it to our CI coverage.

### Modifications:

* Update `appe/swift-nio/scripts/generate_matrix.sh`
* Update reusable adopters of `swift_test_matrix.yml`
* Update end-user adopter workflows of `swift_test_matrix.yml`
  * Copy over test flags from Swift 6.0 jobs

### Result:

NIO tests against Swift 6.1 in CI and downstream repositories can
opt-in.

(Successful CI run with the workflows modified to use the changes on
this branch
https://github.com/apple/swift-nio/actions/runs/14400598096?pr=3196)
2025-04-11 13:45:49 +01:00
Rick Newton-Rogers 5a9130b5c2 Static SDK installation script improvements (#3186)
Static SDK installation script improvements

### Motivation:

Make static SDK installation scripts more modular and make
failures easier to diagnose.

### Modifications:

- Allow specification of binaries from outside the installation script
- Remove script dependency installation from the script
- Separate the Swift dependency installation into its own script
- Fatal error explicitly if the installed Swift can't be found
- Make curl operations for downloading artifacts explicitly fail

### Result:

Scripts which are easier to maintain and operate.

An example CI run with this in operation
https://github.com/apple/swift-nio/actions/runs/14329482180/job/40162003318?pr=3186
2025-04-08 14:27:30 +00:00
Rick Newton-Rogers b4451dc7b9 Update install_static_sdk.sh to cope with versions with no patch (#3166)
Update install_static_sdk.sh to cope with versions with no patch. The
existing `sed` regex assumed `major.minor.patch`
2025-04-01 17:08:04 +01:00
Rick Newton-Rogers 4582f55c0d A re-usable CMake check workflow (#3144)
### Motivation

A few repositories have custom workflows for checking CMake, we would
like to unify this for maintenance and adoption simplicity.

Further to this at the moment they only check that the scripts are
up-to-date, we'd also like to have them build using CMake.

### Modifications

Add the re-usable workflow and supporting scripts

### Result:

Repositories using CMake can switch to the centralised workflow.

An example of it in action
https://github.com/apple/swift-crypto/actions/runs/13837092514/job/38782284575
2025-03-14 15:09:21 +00:00
Rick Newton-Rogers cb26862c5d Make static SDK curl for setup script (#3142)
### Motivation:

The static SDK workflow currently assumes a local setup script which
isn't true for external adopters.

### Modifications:

* The static SDK workflow now curls for the setup script.
* Run Static SDK checks on PR commits

### Result:

External adopters should be unblocked.
2025-03-13 09:52:25 +00:00
Rick Newton-Rogers 2de70653ce A re-usable static SDK compilation workflow (#3019)
A re-usable static SDK compilation workflow

### Motivation:

We would like to offer the ability to opt-in to CI coverage for
compilation against the Linux static SDK.

### Modifications:

Introduce a workflow which will install a Swift snapshot and Linux SDK
and test the repository builds against it.

The script which sets up the VM will install snapshots and SDKs for
either branch or released-version snapshots. They can be specified as:
- a specific version string
- the 'latest' version, the script attempts to find the most recent
  version enumerated on swift.org with both SDK and toolchain available
- the most recent snapshot for the specified branch name enumerated on
  swift.org with both SDK and toolchain available

At the moment the script should work on ubuntu and amazonlinux OSes,
this can be expanded in the future.

The current matrix covers testing building on Ubuntu Jammy for the main
branch and latest released Swift version (6.0.3) and enables it on our
periodic CI runs.

See
https://github.com/apple/swift-nio/actions/runs/13722773053/job/38381907947?pr=3019
for a recent example of this workflow in action.

### Result:

Increased CI coverage
2025-03-10 10:04:15 +00:00
Rick Newton-Rogers 517dccac42 rename nightly 6 1 to nightly next (#3126)
Use nightly_next as swift version

see https://github.com/apple/swift-nio/pull/3122

Motivation:
To not have to rename threshold directories when the nightly branch
changes.

Modifications:
* Use nightly_next as swift version in the matrix generation script
which
is picked up by the benchmark script.
* Move nightly-next thresholds and add legacy symlink

Result:

Benchmark thresholds will attempt to find directories named
nightly_next, not nightly_6_1.
2025-03-04 09:37:47 +00:00
Rick Newton-Rogers 4c14ce5004 Update generate matrix stript to use nightly_next (#3120)
Update generate matrix stript to use nightly_next

### Motivation:

Updating the CI parameters for changing nightly job targets with each
new Swift version (6.0, 6.1, ...) is onerous. Whilst this gives us some
value in the non-nightly pipelines by forcing adopters to apply thought
to what is applied to each supported version, the nightlies arguably
deliver less value in this regard as they tend to be non-required.

### Modifications:

Change flags to refer to nightly_next rather than nightly_6_1, implement
a shim so that the old environment variables still work.

### Result:

We will be able to modify adopter workflows to use nightly_next
terminology.

Example of a job where workflows are using the new matrix
https://github.com/apple/swift-nio/actions/runs/13520016728
2025-02-25 13:58:09 +00:00
Rick Newton-Rogers 187bfa8863 check-matrix-job.sh should tolerate unset 6.1 vars (#3080)
### Motivation:

We recently added support for nightly 6.1 Swift and old scripts making
use of `check-matrix-job.sh` do not set `COMMAND_OVERRIDE_NIGHTLY_6_1`
which causes the script to fail. We should tolerate this.

### Modifications:

Add a default case for `COMMAND_OVERRIDE_NIGHTLY_6_1`.

### Result:

No failures if a caller doesn't specify `COMMAND_OVERRIDE_NIGHTLY_6_1`.

```
❯ SWIFT_VERSION=nightly-6.1 COMMAND="echo foo" COMMAND_OVERRIDE_5_9="" COMMAND_OVERRIDE_5_10="" COMMAND_OVERRIDE_6_0="" COMMAND_OVERRIDE_NIGHTLY_MAIN="" ./scripts/check-matrix-job.sh
** Running default command
foo
❯ SWIFT_VERSION=nightly-6.1 COMMAND="echo foo" COMMAND_OVERRIDE_5_9="" COMMAND_OVERRIDE_5_10="" COMMAND_OVERRIDE_6_0="" COMMAND_OVERRIDE_NIGHTLY_MAIN="" COMMAND_OVERRIDE_NIGHTLY_6_1="echo bar" ./scripts/check-matrix-job.sh
** Running nightly 6.1 command override
bar
```
2025-01-22 15:24:37 +00:00
Rick Newton-Rogers 9336e1f259 more 6.0 nightly to 6.1 nightly CI changes (#3078)
### Motivation:

Some changes were missed in #3076, passing through parameters for the
new 6.1 version.

### Modifications:

Pass through more parameters, clean up misleading comments.

### Result:

6.1 nightly runs will be more like 6.0 nightly runs were
2025-01-22 13:38:02 +00:00
Rick Newton-Rogers 5595698895 Update nightly CI pipelines to 6.1 instead of 6.0 (#3076)
### Motivation:

Active development has moved to 6.1 so the Swift 6.0 nightlies no longer
deliver much value.

### Modifications:

* Deprecate 6.0 nightly CI configuration parameters
* Introduce new 6.1 nightly CI configuration parameters
* Update the matrix generation script to handle 6.1
 
### Result:

* No more nightly 6.0 CI, 6.1 nightlies are introduced.
* Configuration for 6.0 nightlies no longer has any effect.
* All repos are automatically opted-in to 6.1 nightly linux pipelines
**even if they opted out of 6.0**.
2025-01-22 08:26:58 +00:00
Rick Newton-Rogers 969b06b844 rename top matrix workflow object 'swift'->'config' (#3024)
### Motivation:

The use of 'swift' here is very arbitrary and adds no value. The object
is only there at all because GitHub Actions seems to require it.

### Modifications:

Rename the top-level object from 'swift' to 'config' to maybe add value
to the intent of the object and hopefully be less cryptic.

### Result:

Everything should just keep working.
2024-12-13 14:50:27 +01:00
Rick Newton-Rogers d3e8c8c67d Introduce JSON matrix workflow (#3013)
Introduce and adopt a new method for defining test matrices,
`swift_test_matrix.yml`.

⚠️ Any external adopters of the unit tests, Cxx interop and benchmarks
workflows are automatically opted in to use the new infrastructure.

### Motivation:

* The current matrix workflow has the limitation that it only supports
pre-defined sets of variables which are explored in the test matrix. At
the moment this is a pre-defined set of Swift versions on Linux and
Windows.
* Adding more means hard-coding them at multiple levels of the workflow
hierarchy.
* Currently skipped Windows matrix jobs show up as successes in the
GitHub UI leading to a misleading impression of good coverage.

### Modifications:

Introduce and adopt a new method for defining test matrices,
`swift_test_matrix.yml`. The new method is based around the approach of
defining the test matrix via a JSON object which may be supplied via an
input string from another workflow or from a file on-disk in a
repository.

Taking this approach means that we have the ability to add new targets
to the matrix simply by adding new elements to the JSON array,
increasing flexibility and the scope for future growth.

The unit tests, Cxx interop and benchmarks workflows are all modified to
use the new approach, this opts-in all downstream adopters. This should
be transparent to all downstream adopters.

In order to unify the Linux and Windows jobs I removed the use of the
`container:` GitHub Actions affordance in the Linux jobs which
transparently means all steps are executed within the nested container.
Instead we must manually call in to the docker container which
complicates scripting a little. I tested to see if doing this slowed
down the jobs (perhaps GitHub was caching the docker images more
intelligently) but it does not.

This approach follows the pattern of @FranzBusch 's open PR
https://github.com/apple/swift-nio/pull/2942

### Result:

* More flexible test matrix definitions
* No more false-passes for disabled Windows targets
2024-12-05 08:23:51 +00:00
Rick Newton-Rogers d2cc4d7f94 Cxx interop CI appends swiftSettings (#3002)
Cxx interop CI appends `swiftSettings` to any existing settings rather
than overriding them.

### Motivation:

This better accommodates workflows for example which use Swift 5
language mode on a per-target basis.

### Modifications:
Cxx interop CI appends `swiftSettings` to any existing settings rather
than overriding them.

### Result:

Cxx interop CI jobs don't cause unexpected build configurations.
2024-11-26 15:42:10 +00:00
Rick Newton-Rogers 1f1e787f0b Add Cxx interop swift settings to CI (#2999)
### Motivation:

At the moment the Cxx interoperability CI workflow doesn't actually test
Cxx interoperability.

### Modifications:

The script now looks for the precise way that the `Package.swift`
currently formats the target entry and appends a `swiftSettings` entry
to it.

This approach is pretty brittle but has the advantage that it's the same
on Linux and Darwin. If this formatting changes too often then we could
give up on this and assume the availability of gnu-sed instead (and make
sure it's present on our CI containers).

### Result:

All Cxx interoperability checks will check what they are named for.

---------

Co-authored-by: George Barnett <gbarnett@apple.com>
2024-11-25 16:21:41 +00:00
Cory Benfield ae87ce5056 Add netstat -s to nio-diagnose (#2977)
Motivation:

netstat -s can identify many system-wide issues that may be useful extra
data. There's no reason not to collect it.

Modifications:

Add netstat -s to the nio-diagnose script.

Result:

Better diagnostics
2024-11-18 17:40:00 +00:00
Franz Busch ff6dea9d11 [CI] Add Windows matrix build (#2929)
# Motivation

In the long term we want to add support for Windows in our Swift
packages. To do this we need a CI setup to ensure that our packages are
building and the tests are passing.

# Modification

This PR adds a windows job to our swift matrix that installs Swift on
the runner and then uses Swift PM to build and test the package. Windows
jobs are disabled by default since most of our packages require some
work to add Windows support.

# Result

We have a Windows CI pipeline that allows us to verify that our packages
are working.
2024-10-22 08:53:24 +00:00
Franz Busch c16420c4a7 [CI] Migrate to Swift 6.0 and drop 5.8 (#2920)
# Motivation

Our support strategy includes the last three released Swift versions.
After the recent release of Swift 6 this means we now support 5.9, 5.10
and 6.0.

# Modification

This PR updates our CI configuration and scripts to align with our
supported Swift versions.

# Result

Up to date CI coverage.
2024-10-14 16:07:49 +01:00
Peter Adams f7dc3f5275 Re-add CXX compat check script (#2919)
Motivation:

It's still referenced from CI.

Modifications:

Re-add script removed in a previous commit.

Result:

CXX checks on PRs should work again.
2024-10-14 11:09:35 +01:00
Franz Busch 689e94aac0 [CI] Add back matrix CI script (#2916)
Adds back the matrix CI script which I accidentally deleted in a
previous PR.
2024-10-11 16:24:56 +01:00
Franz Busch 8bcc35d062 [CI] Switch to reusable soundness (#2913)
# Motivation

Switch to the reusable workflows from the swiftlang organization for
soundness.

# Modification

This PR moves over to the new reusable soundness workflow. Additionally,
it also deletes all files in this repo for the soundness checks since
they are no longer needed.
2024-10-11 12:53:16 +01:00
Franz Busch aa5c72f80c [CI] License header support .in and .cmake files (#2870)
# Motivation

Some of repos have `.in` and `.cmake` files including header license
comments.

# Modification

This PR adds support to the license check for those type of files.

# Result

Even more license headers.
2024-09-06 14:41:13 +00:00
Franz Busch 76f39c1cdb [CI] Make container images configurable in soundness and matrix jobs … (#2851)
…and remove docc plugin

# Motivation

Some repositories might want to run their soundness and matrix jobs
checks on different container images e.g. a repo might build against the
nightly toolchains only so their soundness jobs should also use nightly
images. Other repos might want to build against a different linux
distribution since their usual deployment target is not Ubuntu based.

Additionally, we currently require our repos to depend on the docc
plugin for building documentation which adds an unnecessary dependency
to all of our packages.

# Modification

This PR makes the container images for the soundness and matrix jobs
configurable. Furthermore, it modifies the docs check script to add the
docc-plugin dependency and removes the current dependency from our
manifest.

# Result

Our workflows can be adopted by more repositories.
2024-08-29 09:15:58 +01:00
Franz Busch 28f9cae996 [CI] Fix docs check (#2811)
# Motivation

I broke the docs check in one of my previous PRs.

# Modification

This PR fixes the docs check again.

# Result

No more broken CI
2024-07-25 17:52:34 +01:00
Franz Busch f17f7e5909 [CI] Add shellcheck and fix up warnings (#2809)
# Motivation

We have quite a lot of shell scripts in our repo and want to make sure that they all pass `shellcheck`.

# Modification

This PR adds a GH action workflow to the soundness script for `shellcheck` and fixes up all errors and warnings.

# Result

No more shell/bash discussions
2024-07-25 14:55:44 +00:00
Franz Busch 541a90026a [CI] Add format ignore file (#2803)
# Motivation

Some repositories may want to exclude files from being format checked.

# Modification

This PR moves the formatting into a separate script and adds an optional `.swiftformatignore` file that can be placed at the repo root similar to the `.licenseignore` file.

# Result

Repos can now decide what files are ignored when running the formatter.
2024-07-24 14:57:59 +01:00
Franz Busch 8a69bd9d88 [GHA] Cxx interoperability compatibility and integration tests check (#2790)
# Motivation

Another reusable check is to make sure that all library products of a package are successfully building when consumed from a module that has Cxx interoperability enabled. Another check that's missing is running the integration tests.

# Modification

This PR adds two new checks to the reusable workflow. One to check for Cxx interoperability compatibility and another one to run the integration tests. I also fixed a misalgined name for the nightly benchmarks.

# Result

This should be one of the last reusable workflow checks.
2024-07-16 01:22:04 -07:00
Franz Busch b1bf036143 [GHA] Introduce reusable matrix workflow (#2789)
* [GHA] Introduce reusable matrix workflow

# Motivation

We have a few checks that we want to run across all supported Swift versions e.g. unit tests and benchmarks. Right now we already added two matrix based jobs to the reusable workflow. This leads to a lot of duplication and harder maintenance.

# Modification

This PR splits off the current reusable workflow to only contain soundness related checks and introduces a new reusable matrix based workflow which can be customized to execute different commands.

# Result

It is now easy to setup multiple matrix based workflows.

* Code review

* Change nightly next
2024-07-15 18:07:03 +01:00
Franz Busch eea0f74cb2 [GHA] Broken symlink and format check (#2787)
# Motivation

The next two reusable checks that we need to create are for broken symlinks and formatting. The latter is disabled for this repo for now since we need to discuss the formatting rules separately.

# Modification

This PR adds two new checks - broken symlinks and formatting.

# Result

Closer to having everything on GitHub actions.
2024-07-12 12:58:37 +01:00