Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Commit 219d30e

Browse files
rnroktoso
authored andcommitted
Migrate CI to use swiftlang / SwiftNIO common GitHub Actions.
Motivation: * Reduce duplication * Centralise boilerplate changes when new Swift versions are picked up. * Benefit from centralised work to add new linting / test infrastructure. Modifications: * The new soundness checks from swiftlang/github-workflows required changes. Mostly around licenses. * After this PR we should come back and enable: * swift-format formatting (possibly with NIO rules) * Some unused scripts and the docker files have been removed. * Adds a script for generating `CONTRIBUTORS.txt` and the file itself Result: More test, linting, formatting coverage. More common CI with other Swift on Server projects.
1 parent e4baaa3 commit 219d30e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+247
-543
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true

.github/workflows/main.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
15+
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
16+
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --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"

.github/workflows/pull_request.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
7+
jobs:
8+
soundness:
9+
name: Soundness
10+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
11+
with:
12+
license_header_check_project_name: "Swift Distributed Tracing"
13+
format_check_enabled: false
14+
15+
unit-tests:
16+
name: Unit tests
17+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
18+
with:
19+
linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
20+
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
21+
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --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+
cxx-interop:
26+
name: Cxx interop
27+
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, reopened, synchronize]
6+
7+
jobs:
8+
semver-label-check:
9+
name: Semantic version label check
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 1
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
persist-credentials: false
17+
- name: Check for Semantic Version label
18+
uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main

.licenseignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.gitignore
2+
**/.gitignore
3+
.licenseignore
4+
.gitattributes
5+
.git-blame-ignore-revs
6+
.mailfilter
7+
.mailmap
8+
.spi.yml
9+
.swiftformat
10+
.swift-format
11+
.swiftformatignore
12+
.editorconfig
13+
.github/*
14+
*.md
15+
*.txt
16+
*.yml
17+
*.yaml
18+
*.json
19+
Package.swift
20+
**/Package.swift
21+
Package@-*.swift
22+
**/Package@-*.swift
23+
Package.resolved
24+
**/Package.resolved
25+
Makefile
26+
*.modulemap
27+
**/*.modulemap
28+
**/*.docc/*
29+
*.xcprivacy
30+
**/*.xcprivacy
31+
*.symlink
32+
**/*.symlink
33+
Dockerfile
34+
**/Dockerfile
35+
Snippets/*
36+
dev/git.commit.template
37+
.unacceptablelanguageignore

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Konrad `ktoso` Malawski <[email protected]> <[email protected]>
2+
Konrad `ktoso` Malawski <[email protected]> <[email protected]>

CONTRIBUTING.md

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,31 +60,10 @@ We require that your commit messages match our template. The easiest way to do t
6060

6161
git config commit.template dev/git.commit.template
6262

63-
### Run `./scripts/soundness.sh`
63+
### Run CI checks locally
6464

65-
The scripts directory contains a [soundness.sh script](https://github.com/apple/swift-distributed-tracing-extras/blob/main/scripts/soundness.sh)
66-
that enforces additional checks, like license headers and formatting style.
67-
68-
Please make sure to `./scripts/soundness.sh` before pushing a change upstream, otherwise it is likely the PR validation will fail
69-
on minor changes such as a missing `self.` or similar formatting issues.
70-
71-
> The script also executes the above mentioned `generate_linux_tests.rb`.
72-
73-
For frequent contributors, we recommend adding the script as a [git pre-push hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks), which you can do via executing the following command in the project root directory:
74-
75-
```bash
76-
cat << EOF > .git/hooks/pre-push
77-
#!/bin/bash
78-
79-
if [[ -f "scripts/soundness.sh" ]]; then
80-
scripts/soundness.sh
81-
fi
82-
EOF
83-
```
84-
85-
Which makes the script execute, and only allow the `git push` to complete if the check has passed.
86-
87-
In the case of formatting issues, you can then `git add` the formatting changes, and attempt the push again.
65+
You can run the GitHub Actions workflows locally using
66+
[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).
8867

8968
## How to contribute your work
9069

CONTRIBUTORS.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
For the purpose of tracking copyright, this is the list of individuals and
2+
organizations who have contributed source code to Swift Distributed Tracing.
3+
4+
For employees of an organization/company where the copyright of work done
5+
by employees of that company is held by the company itself, only the company
6+
needs to be listed here.
7+
8+
## COPYRIGHT HOLDERS
9+
10+
- Apple Inc. (all contributors with '@apple.com')
11+
12+
### Contributors
13+
14+
- Franz Busch <[email protected]>
15+
- Konrad `ktoso` Malawski <[email protected]>
16+
- Moritz Lang <[email protected]>
17+
- Rick Newton-Rogers <[email protected]>
18+
- Yim Lee <[email protected]>
19+
20+
**Updating this list**
21+
22+
Please do not edit this file manually. It is generated using `./scripts/generate_contributors_list.sh`. If a name is misspelled or appearing multiple times: add an entry in `./.mailmap`

NOTICE.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,12 @@ This product contains references to and uses vocabulary defined by the Open Tele
3232
* https://github.com/open-telemetry/opentelemetry-specification/blob/main/LICENSE
3333
* HOMEPAGE:
3434
* https://opentelemetry.io
35+
36+
---
37+
38+
This product contains a script for generating CONTRIBUTORS.txt from Apple/Swift-NIO.
39+
40+
* LICENSE (Apache 2.0):
41+
* https://github.com/apple/swift-nio/blob/main/LICENSE.txt
42+
* HOMEPAGE:
43+
* https://github.com/apple/swift-nio

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.6
1+
// swift-tools-version:5.9
22
import PackageDescription
33

44
let package = Package(

0 commit comments

Comments
 (0)