Skip to content

Commit

Permalink
Follow-up cleanup of GitHub Actions migration (#104)
Browse files Browse the repository at this point in the history
* 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.

* add cxx interop workflows

* enable API breakage checks
  • Loading branch information
rnro authored Nov 22, 2024
1 parent 5a9b2bf commit 1e75872
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 264 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Main

on:
push:
branches: [main]
schedule:
- cron: "0 8,20 * * *"

jobs:
unit-tests:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"

samples:
name: Samples
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
with:
name: "Samples"
matrix_linux_command: "cd Samples/ && swift build --explicit-target-dependency-import-check error"
28 changes: 16 additions & 12 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,25 @@ jobs:
name: Soundness
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
api_breakage_check_enabled: false
license_header_check_project_name: "Swift Cluster Membership"

unit-tests:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"

samples:
name: Samples
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
with:
name: "Unit tests"
matrix_linux_command: "swift test"
matrix_linux_5_9_enabled: false
matrix_linux_5_10_enabled: true
matrix_linux_6_0_enabled: true
matrix_linux_6_0_command_override: "swift test"
matrix_linux_nightly_6_0_enabled: true
matrix_linux_nightly_main_enabled: true
matrix_windows_6_0_enabled: false
matrix_windows_nightly_6_0_enabled: false
matrix_windows_nightly_main_enabled: false
name: "Samples"
matrix_linux_command: "cd Samples/ && swift build --explicit-target-dependency-import-check error"

cxx-interop:
name: Cxx interop
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ We require that your commit messages match our template. The easiest way to do t

### Run CI checks locally

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).
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).

## How to contribute your work

Expand Down
16 changes: 8 additions & 8 deletions Samples/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -7,11 +7,11 @@ var targets: [PackageDescription.Target] = [
.target(
name: "SWIMNIOSampleCluster",
dependencies: [
"SWIM",
"SWIMNIOExample",
"SwiftPrometheus",
"Lifecycle",
"ArgumentParser",
.product(name: "SWIM", package: "swift-cluster-membership"),
.product(name: "SWIMNIOExample", package: "swift-cluster-membership"),
.product(name: "SwiftPrometheus", package: "SwiftPrometheus"),
.product(name: "Lifecycle", package: "swift-service-lifecycle"),
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
path: "Sources/SWIMNIOSampleCluster"
),
Expand All @@ -22,7 +22,7 @@ var targets: [PackageDescription.Target] = [
.testTarget(
name: "NoopTests",
dependencies: [
"SWIM"
.product(name: "SWIM", package: "swift-cluster-membership")
],
path: "Tests/NoopTests"
),
Expand All @@ -42,7 +42,7 @@ var dependencies: [Package.Dependency] = [
let package = Package(
name: "swift-cluster-membership-samples",
platforms: [
.macOS(.v10_12)
.macOS(.v13)
],
products: [
.executable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct SampleSWIMNIONode {
}

final class SWIMNIOSampleHandler: ChannelInboundHandler {
public typealias InboundIn = SWIM.MemberStatusChangedEvent
typealias InboundIn = SWIM.MemberStatusChangedEvent<SWIM.NIOPeer>

let log = Logger(label: "SWIMNIOSample")

Expand Down
31 changes: 0 additions & 31 deletions Samples/Tests/LinuxMain.swift

This file was deleted.

34 changes: 0 additions & 34 deletions docker/Dockerfile

This file was deleted.

33 changes: 0 additions & 33 deletions docker/docker-compose.2204.510.yaml

This file was deleted.

34 changes: 0 additions & 34 deletions docker/docker-compose.2204.59.yaml

This file was deleted.

33 changes: 0 additions & 33 deletions docker/docker-compose.2204.60.yaml

This file was deleted.

34 changes: 0 additions & 34 deletions docker/docker-compose.2204.main.yaml

This file was deleted.

42 changes: 0 additions & 42 deletions docker/docker-compose.yaml

This file was deleted.

0 comments on commit 1e75872

Please sign in to comment.