Skip to content

Commit 2df3239

Browse files
authored
migrate to github actions (#112)
1 parent c8f217f commit 2df3239

File tree

97 files changed

+2098
-1722
lines changed

Some content is hidden

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

97 files changed

+2098
-1722
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
_[One line description of your change]_
2+
3+
### Motivation:
4+
5+
_[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]_
6+
7+
### Modifications:
8+
9+
_[Describe the modifications you've done.]_
10+
11+
### Result:
12+
13+
- Resolves #
14+
- _[After your change, what will change.]_

.github/release.yml

-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ changelog:
1515
- title: 🚨🚨🚨 Missing Labels - Add labels to the prs listed here and generate the release notes again
1616
labels:
1717
- "*"
18-

.github/workflows/pull_request.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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: "RediStack"
13+
14+
unit-tests:
15+
name: Unit tests
16+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
17+
with:
18+
linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}]"
19+
# since we don't have systemctl, we run the redis server manually in the background
20+
linux_pre_build_command: apt-get update -y && apt-get install redis -y
21+
linux_build_command: bash -c 'nohup redis-server & swift test'
22+
enable_windows_checks: false
+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

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
IntegrationTests/*.sh
37+
scripts/generate_contributors_list.sh
38+
scripts/generate_rediscommandencoder_multi_encode.sh

.spi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
version: 1
22
builder:
33
configs:
4-
- documentation_targets: ['RediStack', 'RedisTypes', 'RediStackTestUtils']
4+
- documentation_targets: ['RediStack', 'RedisTypes', 'RediStackTestUtils']

.swift-format

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
"NoBlockComments" : false,
29+
"DontRepeatTypeInStaticProperties" : false,
30+
"AllPublicDeclarationsHaveDocumentation" : false,
31+
"AlwaysUseLiteralForEmptyCollectionInit" : false,
32+
"AlwaysUseLowerCamelCase" : false,
33+
"AmbiguousTrailingClosureOverload" : true,
34+
"BeginDocumentationCommentWithOneLineSummary" : false,
35+
"DoNotUseSemicolons" : true,
36+
"DontRepeatTypeInStaticProperties" : true,
37+
"FileScopedDeclarationPrivacy" : true,
38+
"FullyIndirectEnum" : true,
39+
"GroupNumericLiterals" : true,
40+
"IdentifiersMustBeASCII" : true,
41+
"NeverForceUnwrap" : false,
42+
"NeverUseForceTry" : false,
43+
"NeverUseImplicitlyUnwrappedOptionals" : false,
44+
"NoAccessLevelOnExtensionDeclaration" : true,
45+
"NoAssignmentInExpressions" : true,
46+
"NoBlockComments" : true,
47+
"NoCasesWithOnlyFallthrough" : true,
48+
"NoEmptyTrailingClosureParentheses" : true,
49+
"NoLabelsInCasePatterns" : true,
50+
"NoLeadingUnderscores" : false,
51+
"NoParensAroundConditions" : true,
52+
"NoVoidReturnOnFunctionSignature" : true,
53+
"OmitExplicitReturns" : true,
54+
"OneCasePerLine" : true,
55+
"OneVariableDeclarationPerLine" : true,
56+
"OnlyOneTrailingClosureArgument" : true,
57+
"OrderedImports" : true,
58+
"ReplaceForEachWithForLoop" : true,
59+
"ReturnVoidInsteadOfEmptyTuple" : true,
60+
"UseEarlyExits" : false,
61+
"UseExplicitNilCheckInConditions" : false,
62+
"UseLetInEveryBoundCaseVariable" : false,
63+
"UseShorthandTypeNames" : true,
64+
"UseSingleLinePropertyGetter" : false,
65+
"UseSynthesizedInitializer" : false,
66+
"UseTripleSlashForDocumentationComments" : true,
67+
"UseWhereClausesInForLoops" : false,
68+
"ValidateDocumentationComments" : false
69+
}
70+
}

.yamllint.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: default
2+
3+
rules:
4+
line-length: false
5+
document-start: false
6+
truthy:
7+
check-keys: false # Otherwise we get a false positive on GitHub action's `on` key

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ When adding a new file to the project, add the following heading to the top of t
2222
//
2323
// This source file is part of the RediStack open source project
2424
//
25-
// Copyright (c) 2019-2020 RediStack project authors
25+
// Copyright (c) 2019-2020 Apple Inc. and the RediStack project authors
2626
// Licensed under Apache License v2.0
2727
//
2828
// See LICENSE.txt for license information
@@ -37,7 +37,7 @@ When editing a file, ensure that the copyright header states the year `2019-<cur
3737

3838
### Git Workflow
3939

40-
`master` is always the development branch.
40+
`main` is always the development branch.
4141

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

Package.swift

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// This source file is part of the RediStack open source project
55
//
6-
// Copyright (c) 2019-2023 RediStack project authors
6+
// Copyright (c) 2019-2023 Apple Inc. and the RediStack project authors
77
// Licensed under Apache License v2.0
88
//
99
// See LICENSE.txt for license information
@@ -20,12 +20,12 @@ let package = Package(
2020
products: [
2121
.library(name: "RediStack", targets: ["RediStack"]),
2222
.library(name: "RediStackTestUtils", targets: ["RediStackTestUtils"]),
23-
.library(name: "RedisTypes", targets: ["RedisTypes"])
23+
.library(name: "RedisTypes", targets: ["RedisTypes"]),
2424
],
2525
dependencies: [
2626
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.1.0"),
2727
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
28-
.package(url: "https://github.com/apple/swift-metrics.git", "1.0.0" ..< "3.0.0"),
28+
.package(url: "https://github.com/apple/swift-metrics.git", "1.0.0"..<"3.0.0"),
2929
.package(url: "https://github.com/apple/swift-nio.git", from: "2.43.0"),
3030
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.23.1"),
3131
],
@@ -40,7 +40,7 @@ let package = Package(
4040
.product(name: "NIOSSL", package: "swift-nio-ssl"),
4141
.product(name: "Atomics", package: "swift-atomics"),
4242
.product(name: "Logging", package: "swift-log"),
43-
.product(name: "Metrics", package: "swift-metrics")
43+
.product(name: "Metrics", package: "swift-metrics"),
4444
]
4545
),
4646
.target(name: "RedisTypes", dependencies: ["RediStack"]),
@@ -49,13 +49,13 @@ let package = Package(
4949
dependencies: [
5050
.product(name: "NIOCore", package: "swift-nio"),
5151
.product(name: "NIOEmbedded", package: "swift-nio"),
52-
"RediStack"
52+
"RediStack",
5353
]
5454
),
5555
.target(
5656
name: "RESP3",
5757
dependencies: [
58-
.product(name: "NIOCore", package: "swift-nio"),
58+
.product(name: "NIOCore", package: "swift-nio")
5959
]
6060
),
6161
.testTarget(
@@ -65,14 +65,14 @@ let package = Package(
6565
"RediStackTestUtils",
6666
.product(name: "Atomics", package: "swift-atomics"),
6767
.product(name: "NIO", package: "swift-nio"),
68-
.product(name: "NIOTestUtils", package: "swift-nio")
68+
.product(name: "NIOTestUtils", package: "swift-nio"),
6969
]
7070
),
7171
.testTarget(
7272
name: "RedisTypesTests",
7373
dependencies: [
7474
"RediStack", "RedisTypes", "RediStackTestUtils",
75-
.product(name: "NIO", package: "swift-nio")
75+
.product(name: "NIO", package: "swift-nio"),
7676
]
7777
),
7878
.testTarget(
@@ -88,8 +88,8 @@ let package = Package(
8888
name: "RediStackIntegrationTests",
8989
dependencies: [
9090
"RediStack", "RediStackTestUtils",
91-
.product(name: "NIO", package: "swift-nio")
91+
.product(name: "NIO", package: "swift-nio"),
9292
]
93-
)
93+
),
9494
]
9595
)

Sources/RESP3/RESP3Error.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the RediStack open source project
44
//
5-
// Copyright (c) 2023 RediStack project authors
5+
// Copyright (c) 2023 Apple Inc. and the RediStack project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information

Sources/RESP3/RESP3Token.swift

+9-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the RediStack open source project
44
//
5-
// Copyright (c) 2023 RediStack project authors
5+
// Copyright (c) 2023 Apple Inc. and the RediStack project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -35,7 +35,7 @@ public struct RESP3Token: Hashable, Sendable {
3535
}
3636

3737
public mutating func next() -> RESP3Token? {
38-
return try! RESP3Token(consuming: &self.buffer)
38+
try! RESP3Token(consuming: &self.buffer)
3939
}
4040
}
4141
}
@@ -194,19 +194,19 @@ public struct RESP3Token: Hashable, Sendable {
194194
validated = try buffer.readRESPBooleanSlice()
195195

196196
case .some(.blobString),
197-
.some(.verbatimString),
198-
.some(.blobError):
197+
.some(.verbatimString),
198+
.some(.blobError):
199199
validated = try buffer.readRESPBlobStringSlice()
200200

201201
case .some(.simpleString),
202-
.some(.simpleError):
202+
.some(.simpleError):
203203
validated = try buffer.readRESPSimpleStringSlice()
204204

205205
case .some(.array),
206-
.some(.push),
207-
.some(.set),
208-
.some(.map),
209-
.some(.attribute):
206+
.some(.push),
207+
.some(.set),
208+
.some(.map),
209+
.some(.attribute):
210210
validated = try buffer.readRESPAggregateSlice(depth: depth)
211211

212212
case .some(.integer):
@@ -514,4 +514,3 @@ extension UInt32 {
514514
return value
515515
}()
516516
}
517-

Sources/RESP3/RESP3TokenDecoder.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the RediStack open source project
44
//
5-
// Copyright (c) 2023 RediStack project authors
5+
// Copyright (c) 2023 Apple Inc. and the RediStack project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information

Sources/RESP3/RESP3TypeIdentifier.swift

+16-16
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the RediStack open source project
44
//
5-
// Copyright (c) 2023 RediStack project authors
5+
// Copyright (c) 2023 Apple Inc. and the RediStack project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -13,21 +13,21 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
enum RESP3TypeIdentifier: UInt8 {
16-
case integer = 58 // UInt8(ascii: ":")
17-
case double = 44 // UInt8.comma
18-
case simpleString = 43 // UInt8.plus
19-
case simpleError = 45 // UInt8.min
20-
case blobString = 36 // UInt8.dollar
21-
case blobError = 33 // UInt8.exclamationMark
22-
case verbatimString = 61 // UInt8.equals
23-
case boolean = 35 // UInt8.pound
24-
case null = 95 // UInt8.underscore
25-
case bigNumber = 40 // UInt8.leftRoundBracket
26-
case array = 42 // UInt8.asterisk
27-
case map = 37 // UInt8.percent
28-
case set = 126 // UInt8.tilde
29-
case attribute = 124 // UInt8.pipe
30-
case push = 62 // UInt8.rightAngledBracket
16+
case integer = 58 // UInt8(ascii: ":")
17+
case double = 44 // UInt8.comma
18+
case simpleString = 43 // UInt8.plus
19+
case simpleError = 45 // UInt8.min
20+
case blobString = 36 // UInt8.dollar
21+
case blobError = 33 // UInt8.exclamationMark
22+
case verbatimString = 61 // UInt8.equals
23+
case boolean = 35 // UInt8.pound
24+
case null = 95 // UInt8.underscore
25+
case bigNumber = 40 // UInt8.leftRoundBracket
26+
case array = 42 // UInt8.asterisk
27+
case map = 37 // UInt8.percent
28+
case set = 126 // UInt8.tilde
29+
case attribute = 124 // UInt8.pipe
30+
case push = 62 // UInt8.rightAngledBracket
3131
}
3232

3333
extension UInt8 {

0 commit comments

Comments
 (0)