Skip to content

Commit 5db22e6

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 5db22e6

File tree

91 files changed

+589
-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

+589
-2463
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/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+
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

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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
+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

.licenseignore

+36
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

+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" : 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

-19
This file was deleted.

Benchmarks/.gitkeep

Whitespace-only changes.

Benchmarks/Benchmarks/TracingBenchmarks/AtrributeDSLBenchmark.swift

+5-5
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

+8-8
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"kind" : "remoteSourceControl",
1515
"location" : "https://github.com/ordo-one/package-benchmark.git",
1616
"state" : {
17-
"revision" : "ddf6c1ae01e139120bcdb917ece52819ee69d47a",
18-
"version" : "1.22.1"
17+
"revision" : "d4909695344b6e1ef88f0a711df6ab8708dd135d",
18+
"version" : "1.27.3"
1919
}
2020
},
2121
{
@@ -32,8 +32,8 @@
3232
"kind" : "remoteSourceControl",
3333
"location" : "https://github.com/apple/swift-argument-parser",
3434
"state" : {
35-
"revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41",
36-
"version" : "1.3.0"
35+
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
36+
"version" : "1.5.0"
3737
}
3838
},
3939
{
@@ -59,17 +59,17 @@
5959
"kind" : "remoteSourceControl",
6060
"location" : "https://github.com/apple/swift-service-context.git",
6161
"state" : {
62-
"revision" : "ce0141c8f123132dbd02fd45fea448018762df1b",
63-
"version" : "1.0.0"
62+
"revision" : "0c62c5b4601d6c125050b5c3a97f20cce881d32b",
63+
"version" : "1.1.0"
6464
}
6565
},
6666
{
6767
"identity" : "swift-system",
6868
"kind" : "remoteSourceControl",
6969
"location" : "https://github.com/apple/swift-system",
7070
"state" : {
71-
"revision" : "025bcb1165deab2e20d4eaba79967ce73013f496",
72-
"version" : "1.2.1"
71+
"revision" : "c8a44d836fe7913603e246acab7c528c2e780168",
72+
"version" : "1.4.0"
7373
}
7474
},
7575
{

Benchmarks/Package.swift

+6-6
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+
}
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+
}
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+
}
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+
}
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+
}

0 commit comments

Comments
 (0)