Skip to content

Commit 683b58c

Browse files
committed
Migrate to GitHub Actions
Migrate CI to use GitHub Actions. Motivation: To migrate to GitHub actions and centralised infrastructure. Modifications: Changes of note: * Raise minimum Swift version to 5.9 * Migrate some benchmarks to swift-service-context * Run benchmarks in CI * Adopt swift-format using rules from SwiftNIO * Remove scripts and docker files which are no longer needed Result: GitHub Actions CI in parity with old CI plus benchmarks CI.
1 parent 6483d34 commit 683b58c

File tree

91 files changed

+594
-2463
lines changed

Some content is hidden

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

91 files changed

+594
-2463
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: 25 additions & 0 deletions
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+
benchmarks:
21+
name: Benchmarks
22+
# Workaround https://github.com/nektos/act/issues/1875
23+
uses: apple/swift-nio/.github/workflows/benchmarks.yml@main
24+
with:
25+
benchmark_package_path: "Benchmarks"

.github/workflows/pull_request.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
14+
# FIXME: We cannot use -warnings-as-errors because we inherit from a deprecated type in the Tracer type,
15+
# and we need to keep supporting the old type still. This was introduced as we dropped Swift 5.6 and added 5.9/5.10.
16+
unit-tests:
17+
name: Unit tests
18+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
19+
with:
20+
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
21+
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
22+
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
23+
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
24+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
25+
26+
benchmarks:
27+
name: Benchmarks
28+
uses: apple/swift-nio/.github/workflows/benchmarks.yml@main
29+
with:
30+
benchmark_package_path: "Benchmarks"
31+
32+
cxx-interop:
33+
name: Cxx interop
34+
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
35+
36+
swift-6-language-mode:
37+
name: Swift 6 Language Mode
38+
uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main
39+
if: false # Disabled for now.
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: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.gitignore
2+
**/.gitignore
3+
.licenseignore
4+
.gitattributes
5+
.git-blame-ignore-revs
6+
.mailfilter
7+
.mailmap
8+
.spi.yml
9+
.swift-format
10+
.editorconfig
11+
.github/*
12+
*.md
13+
*.txt
14+
*.yml
15+
*.yaml
16+
*.json
17+
Package.swift
18+
**/Package.swift
19+
Package@-*.swift
20+
**/Package@-*.swift
21+
Package.resolved
22+
**/Package.resolved
23+
Makefile
24+
*.modulemap
25+
**/*.modulemap
26+
**/*.docc/*
27+
*.xcprivacy
28+
**/*.xcprivacy
29+
*.symlink
30+
**/*.symlink
31+
Dockerfile
32+
**/Dockerfile
33+
Snippets/*
34+
dev/git.commit.template
35+
.unacceptablelanguageignore
36+
.dockerignore

.swift-format

Lines changed: 68 additions & 0 deletions
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" : 120,
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+
}

.swiftformat

Lines changed: 0 additions & 19 deletions
This file was deleted.

Benchmarks/.gitkeep

Whitespace-only changes.

Benchmarks/Benchmarks/TracingBenchmarks/AtrributeDSLBenchmark.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22
//
33
// This source file is part of the Swift Distributed Tracing open source project
44
//
5-
// Copyright (c) 2020-2023 Apple Inc. and the Swift Distributed Tracing project
6-
// authors
5+
// Copyright (c) 2020-2023 Apple Inc. and the Swift Distributed Tracing project authors
76
// Licensed under Apache License v2.0
87
//
98
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of Swift Distributed Tracing project authors
1010
//
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
1313
//===----------------------------------------------------------------------===//
1414

1515
import Benchmark
16-
import Tracing
16+
import Tracing
1717

1818
let benchmarks = {
1919
let defaultMetrics: [BenchmarkMetric] = [
20-
.mallocCountTotal,
20+
.mallocCountTotal
2121
]
2222

2323
Benchmark(
24-
"NoopTracing.startSpan/endSpan",
24+
"NoopTracing.startSpan_endSpan",
2525
configuration: .init(
2626
metrics: defaultMetrics,
2727
timeUnits: .nanoseconds,

Benchmarks/Package.resolved

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Benchmarks/Package.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// swift-tools-version: 5.9
22
//===----------------------------------------------------------------------===//
33
//
4-
// This source file is part of the SwiftCertificates open source project
4+
// This source file is part of the Swift Distributed Tracing open source project
55
//
6-
// Copyright (c) 2023 Apple Inc. and the SwiftCertificates project authors
6+
// Copyright (c) 2023 Apple Inc. and the Swift Distributed Tracing project authors
77
// Licensed under Apache License v2.0
88
//
99
// See LICENSE.txt for license information
10-
// See CONTRIBUTORS.txt for the list of SwiftCertificates project authors
10+
// See CONTRIBUTORS.txt for the list of Swift Distributed Tracing project authors
1111
//
1212
// SPDX-License-Identifier: Apache-2.0
1313
//
@@ -18,7 +18,7 @@ import PackageDescription
1818
let package = Package(
1919
name: "benchmarks",
2020
platforms: [
21-
.macOS("14"),
21+
.macOS("14")
2222
],
2323
dependencies: [
2424
.package(path: "../"),
@@ -35,6 +35,6 @@ let package = Package(
3535
plugins: [
3636
.plugin(name: "BenchmarkPlugin", package: "package-benchmark")
3737
]
38-
),
38+
)
3939
]
40-
)
40+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 2
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 1
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 0
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 3
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 1
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 0
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 2
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 1
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 0
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 2
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 1
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 0
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mallocCountTotal" : 2
3+
}

0 commit comments

Comments
 (0)