Skip to content

Commit d87bcb9

Browse files
authored
Migrate CI to use swiftlang / SwiftNIO common GitHub Actions. (#1176)
1 parent 3c03bff commit d87bcb9

File tree

377 files changed

+1351
-1167
lines changed

Some content is hidden

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

377 files changed

+1351
-1167
lines changed

.editorconfig

+8
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/release.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
changelog:
2+
categories:
3+
- title: SemVer Major
4+
labels:
5+
- ⚠️ semver/major
6+
- title: SemVer Minor
7+
labels:
8+
- semver/minor
9+
- title: SemVer Patch
10+
labels:
11+
- semver/patch
12+
- title: Other Changes
13+
labels:
14+
- semver/none

.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_enabled: false
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+
integration-tests:
21+
name: Integration tests
22+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
23+
with:
24+
matrix_linux_5_9_enabled: false
25+
matrix_linux_command: "swift package --disable-sandbox multi-node test"

.github/workflows/pull_request.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
shell_check_enabled: false
13+
format_check_enabled: false
14+
license_header_check_project_name: "Swift Distributed Actors"
15+
# We need to move to 6.0 here but have to fix the new warnings first
16+
docs_check_container_image: "swift:5.10-noble"
17+
18+
unit-tests:
19+
name: Unit tests
20+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
21+
with:
22+
linux_5_9_enabled: false
23+
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
24+
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
25+
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
26+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
27+
28+
integration-tests:
29+
name: Integration tests
30+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
31+
with:
32+
name: "Integration tests"
33+
matrix_linux_5_9_enabled: false
34+
matrix_linux_command: "swift package --disable-sandbox multi-node test"
35+
36+
sample-philosophers:
37+
name: Sample dining philosophers
38+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
39+
with:
40+
name: "Sample dining philosophers"
41+
matrix_linux_5_9_enabled: false
42+
matrix_linux_command: "swift run --package-path Samples SampleDiningPhilosophers"
43+
44+
cxx-interop:
45+
name: Cxx interop
46+
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
47+
with:
48+
linux_5_9_enabled: false
+18
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

.github/workflows/soundness.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Soundness
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
sample-philosophers:
8+
name: Sample dining philosophers
9+
runs-on: ubuntu-latest
10+
container:
11+
image: swift:5.10
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
persist-credentials: false
17+
- name: Mark the workspace as safe
18+
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
19+
- name: Run SampleDiningPhilosophers
20+
run: |
21+
swift run --package-path Samples SampleDiningPhilosophers

.licenseignore

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
*.graffle
20+
*.png
21+
*.plist
22+
*.pdf
23+
*.svg
24+
*.jpeg
25+
Package.swift
26+
**/Package.swift
27+
Package@-*.swift
28+
**/Package@-*.swift
29+
Package.resolved
30+
**/Package.resolved
31+
Makefile
32+
*.modulemap
33+
**/*.modulemap
34+
**/*.docc/*
35+
*.xcprivacy
36+
**/*.xcprivacy
37+
*.symlink
38+
**/*.symlink
39+
Dockerfile
40+
**/Dockerfile
41+
docker/Dockerfile.custom
42+
Snippets/*
43+
dev/git.commit.template
44+
scripts/dev/git.commit.template
45+
.unacceptablelanguageignore
46+
**/.project
47+
**/*.pb.swift
48+
**/*.grpc.swift
49+
Models/mailbox.tla

.spi.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ version: 1
22
builder:
33
configs:
44
- documentation_targets: [DistributedCluster]
5-

.swift-format

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"version" : 1,
3+
"indentation" : {
4+
"spaces" : 4
5+
},
6+
"tabWidth" : 4,
7+
"fileScopedDeclarationPrivacy" : {
8+
"accessLevel" : "private"
9+
},
10+
"spacesAroundRangeFormationOperators" : false,
11+
"indentConditionalCompilationBlocks" : false,
12+
"indentSwitchCaseLabels" : false,
13+
"lineBreakAroundMultilineExpressionChainComponents" : false,
14+
"lineBreakBeforeControlFlowKeywords" : false,
15+
"lineBreakBeforeEachArgument" : true,
16+
"lineBreakBeforeEachGenericRequirement" : true,
17+
"lineLength" : 240,
18+
"maximumBlankLines" : 1,
19+
"respectsExistingLineBreaks" : true,
20+
"prioritizeKeepingFunctionOutputTogether" : true,
21+
"noAssignmentInExpressions" : {
22+
"allowedFunctions" : [
23+
"XCTAssertNoThrow",
24+
"XCTAssertThrowsError"
25+
]
26+
},
27+
"rules" : {
28+
"AllPublicDeclarationsHaveDocumentation" : false,
29+
"AlwaysUseLiteralForEmptyCollectionInit" : false,
30+
"AlwaysUseLowerCamelCase" : false,
31+
"AmbiguousTrailingClosureOverload" : true,
32+
"BeginDocumentationCommentWithOneLineSummary" : false,
33+
"DoNotUseSemicolons" : true,
34+
"DontRepeatTypeInStaticProperties" : true,
35+
"FileScopedDeclarationPrivacy" : true,
36+
"FullyIndirectEnum" : true,
37+
"GroupNumericLiterals" : true,
38+
"IdentifiersMustBeASCII" : true,
39+
"NeverForceUnwrap" : false,
40+
"NeverUseForceTry" : false,
41+
"NeverUseImplicitlyUnwrappedOptionals" : false,
42+
"NoAccessLevelOnExtensionDeclaration" : true,
43+
"NoAssignmentInExpressions" : true,
44+
"NoBlockComments" : true,
45+
"NoCasesWithOnlyFallthrough" : true,
46+
"NoEmptyTrailingClosureParentheses" : true,
47+
"NoLabelsInCasePatterns" : true,
48+
"NoLeadingUnderscores" : false,
49+
"NoParensAroundConditions" : true,
50+
"NoVoidReturnOnFunctionSignature" : true,
51+
"OmitExplicitReturns" : true,
52+
"OneCasePerLine" : true,
53+
"OneVariableDeclarationPerLine" : true,
54+
"OnlyOneTrailingClosureArgument" : true,
55+
"OrderedImports" : true,
56+
"ReplaceForEachWithForLoop" : true,
57+
"ReturnVoidInsteadOfEmptyTuple" : true,
58+
"UseEarlyExits" : false,
59+
"UseExplicitNilCheckInConditions" : false,
60+
"UseLetInEveryBoundCaseVariable" : false,
61+
"UseShorthandTypeNames" : true,
62+
"UseSingleLinePropertyGetter" : false,
63+
"UseSynthesizedInitializer" : false,
64+
"UseTripleSlashForDocumentationComments" : true,
65+
"UseWhereClausesInForLoops" : false,
66+
"ValidateDocumentationComments" : false
67+
}
68+
}

.swiftformatignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.grpc.swift
2+
*.pb.swift

.unacceptablelanguageignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/*.pb.swift
2+
**/*.grpc.swift
3+
dev/protos/upstream/**/*.proto

CONTRIBUTING.md

+3-22
Original file line numberDiff line numberDiff line change
@@ -60,29 +60,10 @@ We require that your commit messages match our template. The easiest way to do t
6060

6161
git config commit.template scripts/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-metrics/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-
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:
72-
73-
```bash
74-
cat << EOF > .git/hooks/pre-push
75-
#!/bin/bash
76-
77-
if [[ -f "scripts/soundness.sh" ]]; then
78-
scripts/soundness.sh
79-
fi
80-
EOF
81-
```
82-
83-
Which makes the script execute, and only allow the `git push` to complete if the check has passed.
84-
85-
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).
8667

8768
## How to contribute your work
8869

CONTRIBUTORS.md CONTRIBUTORS.txt

File renamed without changes.

IntegrationTests/plugin_echo.sh

-58
This file was deleted.

0 commit comments

Comments
 (0)