-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate CI to use GitHub Actions. Motivation: To migrate to GitHub actions and centralised infrastructure. Modifications: Changes of note: * Bump the minimum version to Swift 5.9 in line with CI coverage * Adopt swift-format using rules from SwiftNIO * Remove scripts which are no longer needed Result: Feature parity with old CI. Future improvements: * Enable API breakage checks * Enable YAML linting * Enable Python linting * Set thresholds and enable Benchmarks
- Loading branch information
Showing
48 changed files
with
659 additions
and
486 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Main | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
schedule: | ||
- cron: "0 8,20 * * *" | ||
|
||
jobs: | ||
unit-tests: | ||
name: Unit tests | ||
uses: ./.github/workflows/unit-tests.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
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: "swift-kafka-client" | ||
api_breakage_check_enabled: false # requires libsasl2-dev | ||
yamllint_check_enabled: false # failures in librdkafka, need .yamlignore support | ||
python_lint_check_enabled: false # requires librdkafka, need --exclude support | ||
|
||
unit-tests: | ||
name: Unit tests | ||
uses: ./.github/workflows/unit-tests.yml | ||
|
||
cxx-interop: | ||
name: Cxx interop | ||
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Unit tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
unit-tests: | ||
name: Kafka unit tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release | ||
swift: | ||
- image: "swift:5.9-jammy" | ||
swift_version: "5.9" | ||
enabled: true | ||
- image: "swift:5.10-jammy" | ||
swift_version: "5.10" | ||
enabled: true | ||
- image: "swift:6.0-jammy" | ||
swift_version: "6.0" | ||
enabled: true | ||
- image: "swiftlang/swift:nightly-6.0-jammy" | ||
swift_version: "nightly-6.0" | ||
enabled: true | ||
- image: "swiftlang/swift:nightly-main-jammy" | ||
swift_version: "nightly-main" | ||
enabled: true | ||
steps: | ||
- name: Checkout repository | ||
if: ${{ matrix.swift.enabled }} | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
submodules: true | ||
- name: Mark the workspace as safe | ||
if: ${{ matrix.swift.enabled }} | ||
# https://github.com/actions/checkout/issues/766 | ||
run: git config --global --add safe.directory ${GITHUB_WORKSPACE} | ||
- name: Run matrix job | ||
if: ${{ matrix.swift.enabled }} | ||
env: | ||
SWIFT_VERSION: ${{ matrix.swift.swift_version }} | ||
COMMAND: "swift" | ||
COMMAND_OVERRIDE_5_9: "swift test -Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -strict-concurrency=complete" | ||
COMMAND_OVERRIDE_5_10: "swift test -Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -strict-concurrency=complete" | ||
COMMAND_OVERRIDE_6_0: "swift test --explicit-target-dependency-import-check error" | ||
COMMAND_OVERRIDE_NIGHTLY_6_0: "swift test -Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error" | ||
COMMAND_OVERRIDE_NIGHTLY_MAIN: "swift test -Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error" | ||
run: | | ||
apt-get -qq update && apt-get -qq -y install curl && apt-get -y install libsasl2-dev | ||
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-matrix-job.sh | bash | ||
container: | ||
image: ${{ matrix.swift.image }} | ||
services: | ||
zookeeper: | ||
image: ubuntu/zookeeper | ||
kafka: | ||
image: ubuntu/kafka | ||
env: | ||
ZOOKEEPER_HOST: zookeeper | ||
env: | ||
KAFKA_HOST: kafka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.gitignore | ||
**/.gitignore | ||
.licenseignore | ||
.gitattributes | ||
.gitmodules | ||
.git-blame-ignore-revs | ||
.mailfilter | ||
.mailmap | ||
.spi.yml | ||
.swift-format | ||
.swiftformatignore | ||
.editorconfig | ||
.yamlignore | ||
.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 | ||
.unacceptablelanguageignore | ||
Sources/Crdkafka/* | ||
Sources/COpenSSL/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"version" : 1, | ||
"indentation" : { | ||
"spaces" : 4 | ||
}, | ||
"tabWidth" : 4, | ||
"fileScopedDeclarationPrivacy" : { | ||
"accessLevel" : "private" | ||
}, | ||
"spacesAroundRangeFormationOperators" : false, | ||
"indentConditionalCompilationBlocks" : false, | ||
"indentSwitchCaseLabels" : false, | ||
"lineBreakAroundMultilineExpressionChainComponents" : false, | ||
"lineBreakBeforeControlFlowKeywords" : false, | ||
"lineBreakBeforeEachArgument" : true, | ||
"lineBreakBeforeEachGenericRequirement" : true, | ||
"lineLength" : 120, | ||
"maximumBlankLines" : 1, | ||
"respectsExistingLineBreaks" : true, | ||
"prioritizeKeepingFunctionOutputTogether" : true, | ||
"noAssignmentInExpressions" : { | ||
"allowedFunctions" : [ | ||
"XCTAssertNoThrow", | ||
"XCTAssertThrowsError" | ||
] | ||
}, | ||
"rules" : { | ||
"AllPublicDeclarationsHaveDocumentation" : false, | ||
"AlwaysUseLiteralForEmptyCollectionInit" : 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" : true, | ||
"NoLeadingUnderscores" : false, | ||
"NoParensAroundConditions" : true, | ||
"NoVoidReturnOnFunctionSignature" : true, | ||
"OmitExplicitReturns" : true, | ||
"OneCasePerLine" : true, | ||
"OneVariableDeclarationPerLine" : true, | ||
"OnlyOneTrailingClosureArgument" : true, | ||
"OrderedImports" : true, | ||
"ReplaceForEachWithForLoop" : true, | ||
"ReturnVoidInsteadOfEmptyTuple" : true, | ||
"UseEarlyExits" : false, | ||
"UseExplicitNilCheckInConditions" : false, | ||
"UseLetInEveryBoundCaseVariable" : false, | ||
"UseShorthandTypeNames" : true, | ||
"UseSingleLinePropertyGetter" : false, | ||
"UseSynthesizedInitializer" : false, | ||
"UseTripleSlashForDocumentationComments" : true, | ||
"UseWhereClausesInForLoops" : false, | ||
"ValidateDocumentationComments" : false | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Sources/Crdkafka/* | ||
Sources/COpenSSL/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Sources/Crdkafka/* | ||
Sources/COpenSSL/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.