Skip to content

Commit 885efcb

Browse files
Fix issues with Swift Concurrency and SwiftLint, update GH action
1 parent dc6d3bd commit 885efcb

File tree

6 files changed

+35
-12
lines changed

6 files changed

+35
-12
lines changed

.github/workflows/swift.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ name: Swift
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, develop ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ main, develop ]
88

99
jobs:
1010
build:
1111

1212
runs-on: macos-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v5
1616
- name: Build
1717
run: swift build -v
1818
- name: Run tests
1919
run: swift test -v --enable-code-coverage
2020
- name: Export coverage report as Lcov
21-
run: xcrun llvm-cov export -format="lcov" -instr-profile=.build/x86_64-apple-macosx/debug/codecov/default.profdata .build/x86_64-apple-macosx/debug/ShitLibPackageTests.xctest/Contents/MacOS/ShitLibPackageTests > lcov.info
22-
- uses: codecov/codecov-action@v2
21+
run: xcrun llvm-cov export -format="lcov" -instr-profile=.build/arm64-apple-macosx/debug/codecov/default.profdata .build/arm64-apple-macosx/debug/ShitLibPackageTests.xctest/Contents/MacOS/ShitLibPackageTests > lcov.info
22+
- uses: codecov/codecov-action@v5
2323
with:
2424
files: lcov.info

.swiftlint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
disabled_rules:
2+
- identifier_name

Package.resolved

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
1-
// swift-tools-version:6.2
1+
// swift-tools-version:6.1
22

33
import PackageDescription
44

55
let package = Package(
66
name: "ShitLib",
7+
platforms: [
8+
.macOS(.v12), .iOS(.v15), .tvOS(.v15), .watchOS(.v8), .visionOS(.v2), .macCatalyst(.v15)
9+
],
710
products: [
811
.library(
912
name: "ShitLib",
1013
targets: ["ShitLib"])
1114
],
12-
dependencies: [],
15+
dependencies: [
16+
.package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", from: "0.59.1")
17+
],
1318
targets: [
1419
.target(
1520
name: "ShitLib",
16-
dependencies: []),
21+
dependencies: [],
22+
plugins: [.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins")]),
1723
.testTarget(
1824
name: "ShitLibTests",
19-
dependencies: ["ShitLib"])
25+
dependencies: ["ShitLib"],
26+
plugins: [.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins")])
2027
]
2128
)

Sources/ShitLib/ShitLib.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
public enum OhShit {
9-
public static let osNull: Any? = nil
9+
public static let osNull: (any Sendable)? = nil
1010
public static let osEmpty = ""
1111

1212
public static let osTrue = true
@@ -20,7 +20,6 @@ public enum OhShit {
2020
public static let os0I64: Int64 = 0
2121
public static let os1I64: Int64 = 1
2222

23-
2423
public static func ohShit<T>(_ t: T?) -> T? {
2524
return t
2625
}

Tests/ShitLibTests/ShitLibTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Testing
1111
@Suite("ShitLibTests")
1212
struct ShitLibTests {
1313
private class MyClass {}
14-
14+
1515
@Test func testIsNotNil() throws {
1616
let a: MyClass? = MyClass()
1717
try #require(OhShit.ohShit(a) != nil, "ohShit is nil")

0 commit comments

Comments
 (0)