Skip to content

Commit cdb8e79

Browse files
committed
Follow-up cleanup of GitHub Actions migration
**Motivation:** Make use of more common GitHub Actions migration workflows and repository style changes. **Modifications:** * Unit tests workflows make use of the NIO `unit-tests` workflow with additional checks enabled * Introduce `main.yml` which runs workflows on each commit to `main` and periodically to catch any regressions in merges or from upstream. * Enable nightly CI runs as a signal for upcoming failures as is done in other Swift on Server ecosystem repositories. * Remove the docker files which are no longer used and contained outdated pipelines. * Bring the Samples up to Swift 5.9 and add a CI pipeline to ensure their continued ability to compile. **Result:** More in common with other GitHub Actions adoptions, compiling Samples.
1 parent 5a9b2bf commit cdb8e79

12 files changed

+47
-263
lines changed

.github/workflows/main.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
schedule:
7+
- cron: "0 8,20 * * *"
8+
9+
jobs:
10+
unit-tests:
11+
name: Unit tests
12+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
13+
with:
14+
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
15+
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
16+
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
17+
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
18+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
19+
20+
samples:
21+
name: Samples
22+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
23+
with:
24+
name: "Samples"
25+
matrix_linux_command: "cd Samples/ && swift build --explicit-target-dependency-import-check error"

.github/workflows/pull_request.yml

+12-11
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ jobs:
1414

1515
unit-tests:
1616
name: Unit tests
17+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
18+
with:
19+
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
20+
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
21+
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
22+
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
23+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
24+
25+
samples:
26+
name: Samples
1727
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
1828
with:
19-
name: "Unit tests"
20-
matrix_linux_command: "swift test"
21-
matrix_linux_5_9_enabled: false
22-
matrix_linux_5_10_enabled: true
23-
matrix_linux_6_0_enabled: true
24-
matrix_linux_6_0_command_override: "swift test"
25-
matrix_linux_nightly_6_0_enabled: true
26-
matrix_linux_nightly_main_enabled: true
27-
matrix_windows_6_0_enabled: false
28-
matrix_windows_nightly_6_0_enabled: false
29-
matrix_windows_nightly_main_enabled: false
29+
name: "Samples"
30+
matrix_linux_command: "cd Samples/ && swift build --explicit-target-dependency-import-check error"

CONTRIBUTING.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ We require that your commit messages match our template. The easiest way to do t
7070

7171
### Run CI checks locally
7272

73-
You can run the Github Actions workflows locally using
74-
[act](https://github.com/nektos/act). For detailed steps on how to do this please see [https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally](https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally).
73+
You can run the GitHub Actions workflows locally using [act](https://github.com/nektos/act). For detailed steps on how to do this please see [https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally](https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally).
7574

7675
## How to contribute your work
7776

Samples/Package.swift

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.0
1+
// swift-tools-version:5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
@@ -7,11 +7,11 @@ var targets: [PackageDescription.Target] = [
77
.target(
88
name: "SWIMNIOSampleCluster",
99
dependencies: [
10-
"SWIM",
11-
"SWIMNIOExample",
12-
"SwiftPrometheus",
13-
"Lifecycle",
14-
"ArgumentParser",
10+
.product(name: "SWIM", package: "swift-cluster-membership"),
11+
.product(name: "SWIMNIOExample", package: "swift-cluster-membership"),
12+
.product(name: "SwiftPrometheus", package: "SwiftPrometheus"),
13+
.product(name: "Lifecycle",package: "swift-service-lifecycle"),
14+
.product(name: "ArgumentParser", package: "swift-argument-parser"),
1515
],
1616
path: "Sources/SWIMNIOSampleCluster"
1717
),
@@ -22,7 +22,7 @@ var targets: [PackageDescription.Target] = [
2222
.testTarget(
2323
name: "NoopTests",
2424
dependencies: [
25-
"SWIM"
25+
.product(name: "SWIM", package: "swift-cluster-membership"),
2626
],
2727
path: "Tests/NoopTests"
2828
),
@@ -42,7 +42,7 @@ var dependencies: [Package.Dependency] = [
4242
let package = Package(
4343
name: "swift-cluster-membership-samples",
4444
platforms: [
45-
.macOS(.v10_12)
45+
.macOS(.v13)
4646
],
4747
products: [
4848
.executable(

Samples/Sources/SWIMNIOSampleCluster/SWIMNIOSampleNode.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct SampleSWIMNIONode {
5555
}
5656

5757
final class SWIMNIOSampleHandler: ChannelInboundHandler {
58-
public typealias InboundIn = SWIM.MemberStatusChangedEvent
58+
typealias InboundIn = SWIM.MemberStatusChangedEvent<SWIM.NIOPeer>
5959

6060
let log = Logger(label: "SWIMNIOSample")
6161

Samples/Tests/LinuxMain.swift

-31
This file was deleted.

docker/Dockerfile

-34
This file was deleted.

docker/docker-compose.2204.510.yaml

-33
This file was deleted.

docker/docker-compose.2204.59.yaml

-34
This file was deleted.

docker/docker-compose.2204.60.yaml

-33
This file was deleted.

docker/docker-compose.2204.main.yaml

-34
This file was deleted.

docker/docker-compose.yaml

-42
This file was deleted.

0 commit comments

Comments
 (0)