Skip to content

Commit

Permalink
[CI] Adopt GitHub Actions
Browse files Browse the repository at this point in the history
# Motivation

We want to adopt GitHub actions in all of our Swift repositories to replace our current Jenkins CI.

# Modification

This PR adopts the reusable workflows from NIO and the swiftlang organization to ensure soundness and test coverage. Additionally, this PR enables a sematic label check and adds a `release.yml` to make releasing this package easy.

# Result

Modern CI and release flow.
  • Loading branch information
FranzBusch committed Oct 28, 2024
1 parent 7328a73 commit 1155e33
Show file tree
Hide file tree
Showing 305 changed files with 12,704 additions and 6,501 deletions.
14 changes: 14 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
changelog:
categories:
- title: SemVer Major
labels:
- ⚠️ semver/major
- title: SemVer Minor
labels:
- semver/minor
- title: SemVer Patch
labels:
- semver/patch
- title: Other Changes
labels:
- semver/none
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"

cxx-interop:
name: Cxx interop
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
26 changes: 26 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PR

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
soundness:
name: Soundness
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
license_header_check_project_name: "SwiftNIO"

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

cxx-interop:
name: Cxx interop
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
18 changes: 18 additions & 0 deletions .github/workflows/pull_request_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PR label

on:
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]

jobs:
semver-label-check:
name: Semantic Version label check
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Check for Semantic Version label
uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main
33 changes: 33 additions & 0 deletions .licenseignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.gitignore
**/.gitignore
.gitattributes
.git-blame-ignore-revs
.mailfilter
.mailmap
.spi.yml
.swift-format
.editorconfig
.github/*
*.md
*.txt
*.yml
*.yaml
*.json
Package.swift
**/Package.swift
Package@-*.swift
**/Package@-*.swift
Package.resolved
**/Package.resolved
Makefile
*.modulemap
**/*.modulemap
**/*.docc/*
*.xcprivacy
**/*.xcprivacy
*.symlink
**/*.symlink
Dockerfile
**/Dockerfile
Snippets/*
dev/git.commit.template
58 changes: 58 additions & 0 deletions .swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"fileScopedDeclarationPrivacy" : {
"accessLevel" : "private"
},
"indentation" : {
"spaces" : 4
},
"indentConditionalCompilationBlocks" : false,
"indentSwitchCaseLabels" : false,
"lineBreakAroundMultilineExpressionChainComponents" : false,
"lineBreakBeforeControlFlowKeywords" : false,
"lineBreakBeforeEachArgument" : true,
"lineBreakBeforeEachGenericRequirement" : true,
"lineLength" : 120,
"maximumBlankLines" : 1,
"prioritizeKeepingFunctionOutputTogether" : true,
"respectsExistingLineBreaks" : true,
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : false,
"AlwaysUseLowerCamelCase" : false,
"AmbiguousTrailingClosureOverload" : true,
"BeginDocumentationCommentWithOneLineSummary" : false,
"DoNotUseSemicolons" : true,
"DontRepeatTypeInStaticProperties" : true,
"FileScopedDeclarationPrivacy" : true,
"FullyIndirectEnum" : true,
"GroupNumericLiterals" : true,
"IdentifiersMustBeASCII" : true,
"NeverForceUnwrap" : false,
"NeverUseForceTry" : false,
"NeverUseImplicitlyUnwrappedOptionals" : false,
"NoAccessLevelOnExtensionDeclaration" : true,
"NoAssignmentInExpressions" : true,
"NoBlockComments" : true,
"NoCasesWithOnlyFallthrough" : true,
"NoEmptyTrailingClosureParentheses" : true,
"NoLabelsInCasePatterns" : false,
"NoLeadingUnderscores" : false,
"NoParensAroundConditions" : true,
"NoVoidReturnOnFunctionSignature" : true,
"OneCasePerLine" : true,
"OneVariableDeclarationPerLine" : true,
"OnlyOneTrailingClosureArgument" : true,
"OrderedImports" : false,
"ReturnVoidInsteadOfEmptyTuple" : true,
"UseEarlyExits" : true,
"UseLetInEveryBoundCaseVariable" : false,
"UseShorthandTypeNames" : true,
"UseSingleLinePropertyGetter" : false,
"UseSynthesizedInitializer" : false,
"UseTripleSlashForDocumentationComments" : true,
"UseWhereClausesInForLoops" : false,
"ValidateDocumentationComments" : false
},
"spacesAroundRangeFormationOperators" : false,
"tabWidth" : 4,
"version" : 1
}
19 changes: 0 additions & 19 deletions .swiftformat

This file was deleted.

76 changes: 76 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"configurations": [
{
"type": "lldb",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder:swift-nio-imap}",
"name": "Debug Proxy",
"program": "${workspaceFolder:swift-nio-imap}/.build/debug/Proxy",
"preLaunchTask": "swift: Build Debug Proxy"
},
{
"type": "lldb",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder:swift-nio-imap}",
"name": "Release Proxy",
"program": "${workspaceFolder:swift-nio-imap}/.build/release/Proxy",
"preLaunchTask": "swift: Build Release Proxy"
},
{
"type": "lldb",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder:swift-nio-imap}",
"name": "Debug NIOIMAPPerformanceTester",
"program": "${workspaceFolder:swift-nio-imap}/.build/debug/NIOIMAPPerformanceTester",
"preLaunchTask": "swift: Build Debug NIOIMAPPerformanceTester"
},
{
"type": "lldb",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder:swift-nio-imap}",
"name": "Release NIOIMAPPerformanceTester",
"program": "${workspaceFolder:swift-nio-imap}/.build/release/NIOIMAPPerformanceTester",
"preLaunchTask": "swift: Build Release NIOIMAPPerformanceTester"
},
{
"type": "lldb",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder:swift-nio-imap}",
"name": "Debug NIOIMAPFuzzer",
"program": "${workspaceFolder:swift-nio-imap}/.build/debug/NIOIMAPFuzzer",
"preLaunchTask": "swift: Build Debug NIOIMAPFuzzer"
},
{
"type": "lldb",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder:swift-nio-imap}",
"name": "Release NIOIMAPFuzzer",
"program": "${workspaceFolder:swift-nio-imap}/.build/release/NIOIMAPFuzzer",
"preLaunchTask": "swift: Build Release NIOIMAPFuzzer"
},
{
"type": "lldb",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder:swift-nio-imap}",
"name": "Debug CLI",
"program": "${workspaceFolder:swift-nio-imap}/.build/debug/CLI",
"preLaunchTask": "swift: Build Debug CLI"
},
{
"type": "lldb",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder:swift-nio-imap}",
"name": "Release CLI",
"program": "${workspaceFolder:swift-nio-imap}/.build/release/CLI",
"preLaunchTask": "swift: Build Release CLI"
}
]
}
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ This product contains "Base64.swift", "DecodingError.swift", and "Chromium.swift
* https://github.com/swift-extras/swift-extras-base64

* LICENSE (BSD 2-Clause):
* https://github.com/lemire/fastbase64/blob/master/LICENSE
* https://github.com/lemire/fastbase64/blob/63ed168854875c065bad6c1e6023fbc71f4211df/LICENSE
* HOMEPAGE:
* https://github.com/lemire/fastbase64

* LICENSE (The MIT License):
* https://github.com/client9/stringencoders/blob/master/LICENSE
* https://github.com/client9/stringencoders/blob/7755852327c06a17d95a978dcd013d6789323ded/LICENSE
* HOMEPAGE:
* https://github.com/client9/stringencoders

Expand Down
13 changes: 7 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,26 @@ import PackageDescription
let package = Package(
name: "swift-nio-imap",
products: [
.library(name: "NIOIMAP", targets: ["NIOIMAP"]),
], dependencies: [
.library(name: "NIOIMAP", targets: ["NIOIMAP"])
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio", from: "2.64.0"),
.package(url: "https://github.com/apple/swift-nio-ssl", from: "2.24.0"),
.package(url: "https://github.com/apple/swift-log", from: "1.4.4"),
.package(url: "https://github.com/apple/swift-se0270-range-set.git", from: "1.0.1"),
.package(url: "https://github.com/apple/swift-collections.git", "1.1.0" ..< "2.0.0"),
.package(url: "https://github.com/apple/swift-collections.git", "1.1.0"..<"2.0.0"),
],
targets: [
.executableTarget(
name: "NIOIMAPPerformanceTester",
dependencies: [
"NIOIMAP",
"NIOIMAP"
]
),
.target(
name: "NIOIMAP",
dependencies: [
"NIOIMAPCore",
"NIOIMAPCore"
]
),
.testTarget(
Expand Down Expand Up @@ -57,7 +58,7 @@ let package = Package(
.executableTarget(
name: "CLI",
dependencies: [
"CLILib",
"CLILib"
]
),
.target(
Expand Down
Loading

0 comments on commit 1155e33

Please sign in to comment.