Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to github actions #112

Merged
merged 8 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
_[One line description of your change]_

### Motivation:

_[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]_

### Modifications:

_[Describe the modifications you've done.]_

### Result:

- Resolves #
- _[After your change, what will change.]_
1 change: 0 additions & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ changelog:
- title: 🚨🚨🚨 Missing Labels - Add labels to the prs listed here and generate the release notes again
labels:
- "*"

22 changes: 22 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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: "RediStack"

unit-tests:
name: Unit tests
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}]"
# since we don't have systemctl, we run the redis server manually in the background
linux_pre_build_command: apt-get update -y && apt-get install redis -y
linux_build_command: bash -c 'nohup redis-server & swift test'
enable_windows_checks: false
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
38 changes: 38 additions & 0 deletions .licenseignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.gitignore
**/.gitignore
.licenseignore
.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
.unacceptablelanguageignore
IntegrationTests/*.sh
scripts/generate_contributors_list.sh
scripts/generate_rediscommandencoder_multi_encode.sh
2 changes: 1 addition & 1 deletion .spi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1
builder:
configs:
- documentation_targets: ['RediStack', 'RedisTypes', 'RediStackTestUtils']
- documentation_targets: ['RediStack', 'RedisTypes', 'RediStackTestUtils']
70 changes: 70 additions & 0 deletions .swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"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" : {
"NoBlockComments" : false,
"DontRepeatTypeInStaticProperties" : false,
"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
}
}
7 changes: 7 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: default

rules:
line-length: false
document-start: false
truthy:
check-keys: false # Otherwise we get a false positive on GitHub action's `on` key
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ When adding a new file to the project, add the following heading to the top of t
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019-2020 RediStack project authors
// Copyright (c) 2019-2020 Apple Inc. and the RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
Expand All @@ -37,7 +37,7 @@ When editing a file, ensure that the copyright header states the year `2019-<cur

### Git Workflow

`master` is always the development branch.
`main` is always the development branch.

For **minor** or **patch** SemVer changes, create a branch off of the tagged commit.

Expand Down
20 changes: 10 additions & 10 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019-2023 RediStack project authors
// Copyright (c) 2019-2023 Apple Inc. and the RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
Expand All @@ -20,12 +20,12 @@ let package = Package(
products: [
.library(name: "RediStack", targets: ["RediStack"]),
.library(name: "RediStackTestUtils", targets: ["RediStackTestUtils"]),
.library(name: "RedisTypes", targets: ["RedisTypes"])
.library(name: "RedisTypes", targets: ["RedisTypes"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.1.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-metrics.git", "1.0.0" ..< "3.0.0"),
.package(url: "https://github.com/apple/swift-metrics.git", "1.0.0"..<"3.0.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.43.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.23.1"),
],
Expand All @@ -40,7 +40,7 @@ let package = Package(
.product(name: "NIOSSL", package: "swift-nio-ssl"),
.product(name: "Atomics", package: "swift-atomics"),
.product(name: "Logging", package: "swift-log"),
.product(name: "Metrics", package: "swift-metrics")
.product(name: "Metrics", package: "swift-metrics"),
]
),
.target(name: "RedisTypes", dependencies: ["RediStack"]),
Expand All @@ -49,13 +49,13 @@ let package = Package(
dependencies: [
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
"RediStack"
"RediStack",
]
),
.target(
name: "RESP3",
dependencies: [
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOCore", package: "swift-nio")
]
),
.testTarget(
Expand All @@ -65,14 +65,14 @@ let package = Package(
"RediStackTestUtils",
.product(name: "Atomics", package: "swift-atomics"),
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOTestUtils", package: "swift-nio")
.product(name: "NIOTestUtils", package: "swift-nio"),
]
),
.testTarget(
name: "RedisTypesTests",
dependencies: [
"RediStack", "RedisTypes", "RediStackTestUtils",
.product(name: "NIO", package: "swift-nio")
.product(name: "NIO", package: "swift-nio"),
]
),
.testTarget(
Expand All @@ -88,8 +88,8 @@ let package = Package(
name: "RediStackIntegrationTests",
dependencies: [
"RediStack", "RediStackTestUtils",
.product(name: "NIO", package: "swift-nio")
.product(name: "NIO", package: "swift-nio"),
]
)
),
]
)
2 changes: 1 addition & 1 deletion Sources/RESP3/RESP3Error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2023 RediStack project authors
// Copyright (c) 2023 Apple Inc. and the RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
Expand Down
19 changes: 9 additions & 10 deletions Sources/RESP3/RESP3Token.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2023 RediStack project authors
// Copyright (c) 2023 Apple Inc. and the RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
Expand Down Expand Up @@ -35,7 +35,7 @@ public struct RESP3Token: Hashable, Sendable {
}

public mutating func next() -> RESP3Token? {
return try! RESP3Token(consuming: &self.buffer)
try! RESP3Token(consuming: &self.buffer)
}
}
}
Expand Down Expand Up @@ -194,19 +194,19 @@ public struct RESP3Token: Hashable, Sendable {
validated = try buffer.readRESPBooleanSlice()

case .some(.blobString),
.some(.verbatimString),
.some(.blobError):
.some(.verbatimString),
.some(.blobError):
validated = try buffer.readRESPBlobStringSlice()

case .some(.simpleString),
.some(.simpleError):
.some(.simpleError):
validated = try buffer.readRESPSimpleStringSlice()

case .some(.array),
.some(.push),
.some(.set),
.some(.map),
.some(.attribute):
.some(.push),
.some(.set),
.some(.map),
.some(.attribute):
validated = try buffer.readRESPAggregateSlice(depth: depth)

case .some(.integer):
Expand Down Expand Up @@ -514,4 +514,3 @@ extension UInt32 {
return value
}()
}

2 changes: 1 addition & 1 deletion Sources/RESP3/RESP3TokenDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2023 RediStack project authors
// Copyright (c) 2023 Apple Inc. and the RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
Expand Down
32 changes: 16 additions & 16 deletions Sources/RESP3/RESP3TypeIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2023 RediStack project authors
// Copyright (c) 2023 Apple Inc. and the RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
Expand All @@ -13,21 +13,21 @@
//===----------------------------------------------------------------------===//

enum RESP3TypeIdentifier: UInt8 {
case integer = 58 // UInt8(ascii: ":")
case double = 44 // UInt8.comma
case simpleString = 43 // UInt8.plus
case simpleError = 45 // UInt8.min
case blobString = 36 // UInt8.dollar
case blobError = 33 // UInt8.exclamationMark
case verbatimString = 61 // UInt8.equals
case boolean = 35 // UInt8.pound
case null = 95 // UInt8.underscore
case bigNumber = 40 // UInt8.leftRoundBracket
case array = 42 // UInt8.asterisk
case map = 37 // UInt8.percent
case set = 126 // UInt8.tilde
case attribute = 124 // UInt8.pipe
case push = 62 // UInt8.rightAngledBracket
case integer = 58 // UInt8(ascii: ":")
case double = 44 // UInt8.comma
case simpleString = 43 // UInt8.plus
case simpleError = 45 // UInt8.min
case blobString = 36 // UInt8.dollar
case blobError = 33 // UInt8.exclamationMark
case verbatimString = 61 // UInt8.equals
case boolean = 35 // UInt8.pound
case null = 95 // UInt8.underscore
case bigNumber = 40 // UInt8.leftRoundBracket
case array = 42 // UInt8.asterisk
case map = 37 // UInt8.percent
case set = 126 // UInt8.tilde
case attribute = 124 // UInt8.pipe
case push = 62 // UInt8.rightAngledBracket
}

extension UInt8 {
Expand Down
Loading