Compare commits

..
Author SHA1 Message Date
Franz Busch b20468db88 [CI] Migrate to GHA
# Motivation

We want to modernize our CI.

# Modification

This PR migrates to GH actions and turns on all the right flags.

# Result

Modern CI.
2024-10-30 13:12:02 +00:00
9 changed files with 18 additions and 75 deletions

No files matched your search

-8
View File
@@ -1,8 +0,0 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
+2 -2
View File
@@ -5,10 +5,10 @@ changelog:
- ⚠️ semver/major
- title: SemVer Minor
labels:
- 🆕 semver/minor
- semver/minor
- title: SemVer Patch
labels:
- 🔨 semver/patch
- semver/patch
- title: Other Changes
labels:
- semver/none
+5 -5
View File
@@ -11,16 +11,16 @@ jobs:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
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 -Xswiftc -require-explicit-sendable"
linux_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
windows_6_0_enabled: true
windows_nightly_6_1_enabled: true
windows_nightly_6_0_enabled: true
windows_nightly_main_enabled: true
windows_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
windows_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
windows_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
windows_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
cxx-interop:
+6 -6
View File
@@ -13,18 +13,18 @@ jobs:
unit-tests:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@matrix_windows
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
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 -Xswiftc -require-explicit-sendable"
linux_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
windows_6_0_enabled: true
windows_nightly_6_1_enabled: true
windows_nightly_6_0_enabled: true
windows_nightly_main_enabled: true
windows_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
windows_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
windows_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
windows_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
cxx-interop:
+1 -1
View File
@@ -6,7 +6,7 @@ on:
jobs:
semver-label-check:
name: Semantic version label check
name: Semantic Version label check
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
+1 -18
View File
@@ -1,4 +1,4 @@
// swift-tools-version:5.9
// swift-tools-version:5.8
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Logging API open source project
@@ -31,20 +31,3 @@ let package = Package(
),
]
)
for target in package.targets {
var settings = target.swiftSettings ?? []
settings.append(.enableExperimentalFeature("StrictConcurrency=complete"))
target.swiftSettings = settings
}
// --- STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- //
for target in package.targets {
if target.type != .plugin {
var settings = target.swiftSettings ?? []
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md
settings.append(.enableUpcomingFeature("MemberImportVisibility"))
target.swiftSettings = settings
}
}
// --- END: STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- //
+1 -6
View File
@@ -85,9 +85,6 @@ You can choose from one of the following backends to consume your logs. If you a
| [CocoaLumberjack](https://github.com/CocoaLumberjack/CocoaLumberjack) | a fast & simple, yet powerful & flexible logging framework for macOS, iOS, tvOS and watchOS, which includes a logging backend for swift-log. |
| [rwbutler/swift-log-ecs](https://github.com/rwbutler/swift-log-ecs) | a logging backend for logging in [ECS Log format](https://www.elastic.co/guide/en/ecs-logging/overview/current/intro.html). Compatible with [Vapor](https://github.com/vapor/vapor) and allows chaining of multiple LogHandlers. |
| [ShipBook/swift-log-**shipbook**](https://github.com/ShipBook/swift-log-shipbook) | a logging backend that sends log entries to [Shipbook](https://www.shipbook.io) - Shipbook gives you the power to remotely gather, search and analyze your user logs and exceptions in the cloud, on a per-user & session basis. |
| [kasianov-mikhail/scout](https://github.com/kasianov-mikhail/scout) | CloudKit as a log storage |
| [PADL/AndroidLogging](https://github.com/PADL/AndroidLogging) | a logging backend for the Android in-kernel log buffer |
| [xtremekforever/swift-systemd](https://github.com/xtremekforever/swift-systemd) | a logging backend for the [systemd](https://systemd.io/) journal |
| Your library? | [Get in touch!](https://forums.swift.org/c/server) |
## What is an API package?
@@ -172,9 +169,7 @@ public protocol LogHandler {
Instructing `SwiftLog` to use your logging backend as the one the whole application (including all libraries) should use is very simple:
```swift
LoggingSystem.bootstrap(MyLogHandler.init)
```
LoggingSystem.bootstrap(MyLogHandler.init)
### Implementation considerations
+1 -1
View File
@@ -750,7 +750,7 @@ public enum LoggingSystem {
}
/// Protects an object applying the constraints that it can only be accessed through a Reader-Writer lock
/// and can only be updated once from the initial value given.
/// and can ony bre updated once from the initial value given.
private struct ReplaceOnceBox<BoxedType: Sendable> {
private struct ReplaceOnce: Sendable {
private var initialized = false
+1 -28
View File
@@ -1076,11 +1076,7 @@ class LoggingTest: XCTestCase {
let testString = "hello\u{0} world"
log.critical("\(testString)")
#if os(Windows)
let size = _read(readFD, readBuffer, 256)
#else
let size = read(readFD, readBuffer, 256)
#endif
let output = String(
decoding: UnsafeRawBufferPointer(start: UnsafeRawPointer(readBuffer), count: numericCast(size)),
@@ -1098,20 +1094,11 @@ class LoggingTest: XCTestCase {
LoggingSystem.bootstrapInternal { StreamLogHandler(label: $0, stream: logStream) }
Logger(label: "test").critical("test")
#if os(Windows)
let size = _read(readFD, readBuffer, 256)
#else
let size = read(readFD, readBuffer, 256)
#endif
XCTAssertGreaterThan(size, -1, "expected flush")
logStream.flush()
#if os(Windows)
let size2 = _read(readFD, readBuffer, 256)
#else
let size2 = read(readFD, readBuffer, 256)
#endif
XCTAssertEqual(size2, -1, "expected no flush")
}
// default flushing
@@ -1120,20 +1107,11 @@ class LoggingTest: XCTestCase {
LoggingSystem.bootstrapInternal { StreamLogHandler(label: $0, stream: logStream) }
Logger(label: "test").critical("test")
#if os(Windows)
let size = _read(readFD, readBuffer, 256)
#else
let size = read(readFD, readBuffer, 256)
#endif
XCTAssertEqual(size, -1, "expected no flush")
logStream.flush()
#if os(Windows)
let size2 = _read(readFD, readBuffer, 256)
#else
let size2 = read(readFD, readBuffer, 256)
#endif
XCTAssertGreaterThan(size2, -1, "expected flush")
}
}
@@ -1145,15 +1123,14 @@ class LoggingTest: XCTestCase {
let err = _pipe($0.baseAddress, 256, _O_BINARY)
XCTAssertEqual(err, 0, "_pipe failed \(err)")
}
let writeFD = _fdopen(fds[1], "w")
#else
fds.withUnsafeMutableBufferPointer { ptr in
let err = pipe(ptr.baseAddress!)
XCTAssertEqual(err, 0, "pipe failed \(err)")
}
let writeFD = fdopen(fds[1], "w")
#endif
let writeFD = fdopen(fds[1], "w")
let writeBuffer = UnsafeMutablePointer<Int8>.allocate(capacity: 256)
defer {
writeBuffer.deinitialize(count: 256)
@@ -1186,11 +1163,7 @@ class LoggingTest: XCTestCase {
body(writeFD!, readFD, readBuffer)
for fd in fds {
#if os(Windows)
_close(fd)
#else
close(fd)
#endif
}
}