Skip to content

Commit 43929b0

Browse files
authored
Minor package cleanup (#464)
* Disable CodeQL CI, since GitHub seems disinclined to fix their mistakes. * Fix a few very minor issues in the API docs and README. * Make LOG_LEVEL env actually work in tests * Update CI for Swift 5.10 release * We only need two macOS tests, not four
1 parent b6496eb commit 43929b0

File tree

8 files changed

+67
-132
lines changed

8 files changed

+67
-132
lines changed

.github/workflows/test.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
- swift:5.7-jammy
2222
- swift:5.8-jammy
2323
- swift:5.9-jammy
24-
- swiftlang/swift:nightly-5.10-jammy
24+
- swift:5.10-jammy
2525
- swiftlang/swift:nightly-main-jammy
2626
include:
27-
- swift-image: swift:5.9-jammy
27+
- swift-image: swift:5.10-jammy
2828
code-coverage: true
2929
container: ${{ matrix.swift-image }}
3030
runs-on: ubuntu-latest
@@ -63,7 +63,7 @@ jobs:
6363
- postgres-image: postgres:12
6464
postgres-auth: trust
6565
container:
66-
image: swift:5.9-jammy
66+
image: swift:5.10-jammy
6767
volumes: [ 'pgrunshare:/var/run/postgresql' ]
6868
runs-on: ubuntu-latest
6969
env:
@@ -140,7 +140,12 @@ jobs:
140140
xcode-version:
141141
- '~14.3'
142142
- '~15.0'
143-
runs-on: macos-13
143+
include:
144+
- xcode-version: '~14.3'
145+
macos-version: 'macos-13'
146+
- xcode-version: '~15.0'
147+
macos-version: 'macos-14'
148+
runs-on: ${{ matrix.macos-version }}
144149
env:
145150
POSTGRES_HOSTNAME: 127.0.0.1
146151
POSTGRES_USER: 'test_username'
@@ -188,19 +193,20 @@ jobs:
188193
swift package diagnose-api-breaking-changes origin/main
189194
190195
gh-codeql:
196+
if: ${{ false }}
191197
runs-on: ubuntu-latest
192-
container: swift:5.9-jammy
198+
container: swift:jammy
193199
permissions: { actions: write, contents: read, security-events: write }
194200
steps:
195201
- name: Check out code
196202
uses: actions/checkout@v4
197203
- name: Mark repo safe in non-fake global config
198204
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
199205
- name: Initialize CodeQL
200-
uses: github/codeql-action/init@v2
206+
uses: github/codeql-action/init@v3
201207
with:
202208
languages: swift
203209
- name: Perform build
204210
run: swift build
205211
- name: Run CodeQL analyze
206-
uses: github/codeql-action/analyze@v2
212+
uses: github/codeql-action/analyze@v3

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<img src="https://img.shields.io/github/actions/workflow/status/vapor/postgres-nio/test.yml?event=push&style=plastic&logo=github&label=tests&logoColor=%23ccc" alt="Continuous Integration">
1717
</a>
1818
<a href="https://swift.org">
19-
<img src="https://design.vapor.codes/images/swift57up.svg" alt="Swift 5.7 +">
19+
<img src="https://design.vapor.codes/images/swift57up.svg" alt="Swift 5.7+">
2020
</a>
21-
<a name="https://www.swift.org/sswg/incubation-process.html">
22-
<img src="https://img.shields.io/badge/sswg-graduated-white.svg?style=plastic&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImIiPjxzdG9wIHN0b3AtY29sb3I9IiNmZDIwMjAiIHN0eWxlPSJzdG9wLWNvbG9yOiNlMDE1OTUiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNmODhhMzYiIHN0eWxlPSJzdG9wLWNvbG9yOiNhNTNmOGEiIG9mZnNldD0iLjY5OSIvPjwvbGluZWFyR3JhZGllbnQ%2BPGxpbmVhckdyYWRpZW50IGlkPSJjIiB4MT0iNDIzIiB4Mj0iNzMiIHkxPSI3MyIgeTI9IjQyMyIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg4LDgpIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaHJlZj0iI2IiLz48L2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QtMTE4LjQtOTcuNy0xLjQtMS40IDMzLjIgNDkuNiA3MS45IDkwLjYtMTguMy0xMC42LTY5LjctNDguMS0xMDIuMS03Ny44IDQuMiA2LjMgOC40IDEzLjQgMTQgMTkuMSAyNi44IDM0LjcgNjIuOCA3Ny4yIDEwNSAxMDkuN2wwLjEgMC4xYy0yOS43IDE4LjQtNzIgMTkuOC0xMTQuMi0wLjEtMTAuNi00LjktMjAuNC0xMC42LTI4LjktMTcuNyAxNy42IDI4LjMgNDUuMSA1My4xIDc4LjIgNjcuMyA0MC45IDE3LjYgODEuNiAxNS44IDExMS4xLTEuMyAxNC40LTYuMSA0Mi43LTE1LjMgNTggMTQuNyAzLjUgNy4xIDExLjMtMzAuNC0xNi45LTY1LjgtMC4yLTAuMi0wLjMtMC40LTAuNS0wLjYgMC40LTEuNCAwLjgtMi45IDEuMi00LjQgMTQuMS01NC41LTE5LjctMTE5LjYtNzYuOC0xNTQuM3oiIHN0eWxlPSJmaWxsOnVybCgjZCkiLz48L3N2Zz4K&labelColor=gray&color=%23e01595" alt="SSWG Incubation Level: Graduated">
21+
<a href="https://www.swift.org/sswg/incubation-process.html">
22+
<img src="https://design.vapor.codes/images/sswg-graduated.svg" alt="SSWG Incubation Level: Graduated">
2323
</a>
2424
</p>
2525

Sources/PostgresNIO/Docs.docc/images/article.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

Sources/PostgresNIO/Docs.docc/images/vapor-postgres-logo.svg

Lines changed: 0 additions & 60 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Loading
Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,21 @@
11
{
2-
"theme": {
3-
"aside": {
4-
"border-radius": "6px",
5-
"border-style": "double",
6-
"border-width": "3px"
7-
},
8-
"border-radius": "0",
9-
"button": {
10-
"border-radius": "16px",
11-
"border-width": "1px",
12-
"border-style": "solid"
13-
},
14-
"code": {
15-
"border-radius": "16px",
16-
"border-width": "1px",
17-
"border-style": "solid"
18-
},
19-
"color": {
20-
"fill": {
21-
"dark": "rgb(0, 0, 0)",
22-
"light": "rgb(255, 255, 255)"
23-
},
24-
"psql-blue": "#336791",
25-
"documentation-intro-fill": "radial-gradient(circle at top, var(--color-documentation-intro-accent) 30%, #000 100%)",
26-
"documentation-intro-accent": "var(--color-psql-blue)",
27-
"documentation-intro-accent-outer": {
28-
"dark": "rgb(255, 255, 255)",
29-
"light": "rgb(0, 0, 0)"
30-
},
31-
"documentation-intro-accent-inner": {
32-
"dark": "rgb(0, 0, 0)",
33-
"light": "rgb(255, 255, 255)"
34-
}
35-
},
36-
"icons": {
37-
"technology": "/postgresnio/images/vapor-postgres-logo.svg",
38-
"article": "/postgresnio/images/article.svg"
39-
}
2+
"theme": {
3+
"aside": { "border-radius": "6px", "border-style": "double", "border-width": "3px" },
4+
"border-radius": "0",
5+
"button": { "border-radius": "16px", "border-width": "1px", "border-style": "solid" },
6+
"code": { "border-radius": "16px", "border-width": "1px", "border-style": "solid" },
7+
"color": {
8+
"psqlnio": "#336791",
9+
"documentation-intro-fill": "radial-gradient(circle at top, var(--color-psqlnio) 30%, #000 100%)",
10+
"documentation-intro-accent": "var(--color-psqlnio)",
11+
"logo-base": { "dark": "#fff", "light": "#000" },
12+
"logo-shape": { "dark": "#000", "light": "#fff" },
13+
"fill": { "dark": "#000", "light": "#fff" }
4014
},
41-
"features": {
42-
"quickNavigation": {
43-
"enable": true
44-
}
45-
}
15+
"icons": { "technology": "/postgresnio/images/vapor-postgresnio-logo.svg" }
16+
},
17+
"features": {
18+
"quickNavigation": { "enable": true },
19+
"i18n": { "enable": true }
20+
}
4621
}

Tests/IntegrationTests/PostgresNIOTests.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ import NIOSSL
99
final class PostgresNIOTests: XCTestCase {
1010

1111
private var group: EventLoopGroup!
12-
1312
private var eventLoop: EventLoop { self.group.next() }
1413

14+
override class func setUp() {
15+
XCTAssertTrue(isLoggingConfigured)
16+
}
17+
1518
override func setUpWithError() throws {
1619
try super.setUpWithError()
17-
XCTAssertTrue(isLoggingConfigured)
1820
self.group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
1921
}
2022

@@ -1475,7 +1477,7 @@ final class PostgresNIOTests: XCTestCase {
14751477
let isLoggingConfigured: Bool = {
14761478
LoggingSystem.bootstrap { label in
14771479
var handler = StreamLogHandler.standardOutput(label: label)
1478-
handler.logLevel = env("LOG_LEVEL").flatMap { Logger.Level(rawValue: $0) } ?? .debug
1480+
handler.logLevel = env("LOG_LEVEL").flatMap { .init(rawValue: $0) } ?? .info
14791481
return handler
14801482
}
14811483
return true

Tests/IntegrationTests/Utilities.swift

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ extension PostgresConnection {
2424
}
2525
}
2626

27-
static func test(on eventLoop: EventLoop, logLevel: Logger.Level = .info) -> EventLoopFuture<PostgresConnection> {
28-
var logger = Logger(label: "postgres.connection.test")
29-
logger.logLevel = logLevel
30-
27+
static func test(on eventLoop: EventLoop) -> EventLoopFuture<PostgresConnection> {
28+
let logger = Logger(label: "postgres.connection.test")
3129
let config = PostgresConnection.Configuration(
3230
host: env("POSTGRES_HOSTNAME") ?? "localhost",
3331
port: env("POSTGRES_PORT").flatMap(Int.init(_:)) ?? 5432,
@@ -40,10 +38,8 @@ extension PostgresConnection {
4038
return PostgresConnection.connect(on: eventLoop, configuration: config, id: 0, logger: logger)
4139
}
4240

43-
static func testUDS(on eventLoop: EventLoop, logLevel: Logger.Level = .info) -> EventLoopFuture<PostgresConnection> {
44-
var logger = Logger(label: "postgres.connection.test")
45-
logger.logLevel = logLevel
46-
41+
static func testUDS(on eventLoop: EventLoop) -> EventLoopFuture<PostgresConnection> {
42+
let logger = Logger(label: "postgres.connection.test")
4743
let config = PostgresConnection.Configuration(
4844
unixSocketPath: env("POSTGRES_SOCKET") ?? "/tmp/.s.PGSQL.\(env("POSTGRES_PORT").flatMap(Int.init(_:)) ?? 5432)",
4945
username: env("POSTGRES_USER") ?? "test_username",
@@ -54,10 +50,8 @@ extension PostgresConnection {
5450
return PostgresConnection.connect(on: eventLoop, configuration: config, id: 0, logger: logger)
5551
}
5652

57-
static func testChannel(_ channel: Channel, on eventLoop: EventLoop, logLevel: Logger.Level = .info) -> EventLoopFuture<PostgresConnection> {
58-
var logger = Logger(label: "postgres.connection.test")
59-
logger.logLevel = logLevel
60-
53+
static func testChannel(_ channel: Channel, on eventLoop: EventLoop) -> EventLoopFuture<PostgresConnection> {
54+
let logger = Logger(label: "postgres.connection.test")
6155
let config = PostgresConnection.Configuration(
6256
establishedChannel: channel,
6357
username: env("POSTGRES_USER") ?? "test_username",
@@ -71,9 +65,7 @@ extension PostgresConnection {
7165

7266
extension Logger {
7367
static var psqlTest: Logger {
74-
var logger = Logger(label: "psql.test")
75-
logger.logLevel = .info
76-
return logger
68+
.init(label: "psql.test")
7769
}
7870
}
7971

0 commit comments

Comments
 (0)