diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ac3eeb..d32bd45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,7 @@ jobs: - release name: Linux runs-on: ubuntu-latest - container: swift:5.10 + container: swift:6.0.3 steps: - uses: actions/checkout@v4 - name: Install dependencies @@ -110,7 +110,7 @@ jobs: echo "$PREFIX/usr/bin" >> $GITHUB_PATH - name: Build - run: swift build --swift-sdk wasm32-unknown-wasi --build-tests -Xlinker -z -Xlinker stack-size=$((1024 * 1024)) + run: swift build --target IssueReporting --swift-sdk wasm32-unknown-wasi -Xlinker -z -Xlinker stack-size=$((1024 * 1024)) windows: name: Windows @@ -141,4 +141,4 @@ jobs: steps: - uses: actions/checkout@v4 - name: "Test Swift Package on Android" - uses: skiptools/swift-android-action@v2 \ No newline at end of file + uses: skiptools/swift-android-action@v2 diff --git a/Makefile b/Makefile index f301a3e..ba50097 100644 --- a/Makefile +++ b/Makefile @@ -45,10 +45,11 @@ format: --in-place \ --recursive \ . + test-linux: docker run \ --rm \ -v "$(PWD):$(PWD)" \ -w "$(PWD)" \ - swift:5.10 \ + swift:6.0.3-focal \ bash -c 'swift test -c $(CONFIG)' diff --git a/Package.swift b/Package.swift index 88a6c54..f3a8668 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,11 @@ let package = Package( ], products: [ .library(name: "IssueReporting", targets: ["IssueReporting"]), - .library(name: "IssueReportingTestSupport", targets: ["IssueReportingTestSupport"]), + .library( + name: "IssueReportingTestSupport", + type: .dynamic, + targets: ["IssueReportingTestSupport"] + ), .library(name: "XCTestDynamicOverlay", targets: ["XCTestDynamicOverlay"]), ], targets: [ diff --git a/Package@swift-6.0.swift b/Package@swift-6.0.swift index 624c844..22f30ee 100644 --- a/Package@swift-6.0.swift +++ b/Package@swift-6.0.swift @@ -12,7 +12,11 @@ let package = Package( ], products: [ .library(name: "IssueReporting", targets: ["IssueReporting"]), - .library(name: "IssueReportingTestSupport", targets: ["IssueReportingTestSupport"]), + .library( + name: "IssueReportingTestSupport", + type: .dynamic, + targets: ["IssueReportingTestSupport"] + ), .library(name: "XCTestDynamicOverlay", targets: ["XCTestDynamicOverlay"]), ], targets: [ @@ -44,12 +48,6 @@ let package = Package( swiftLanguageModes: [.v6] ) -#if os(Linux) || os(Windows) - package.dependencies.append( - .package(url: "https://github.com/apple/swift-testing", from: "0.11.0") - ) -#endif - #if os(macOS) package.dependencies.append(contentsOf: [ .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"), diff --git a/Sources/IssueReporting/Internal/SwiftTesting.swift b/Sources/IssueReporting/Internal/SwiftTesting.swift index 4dbe056..d31860c 100644 --- a/Sources/IssueReporting/Internal/SwiftTesting.swift +++ b/Sources/IssueReporting/Internal/SwiftTesting.swift @@ -14,7 +14,7 @@ func _recordIssue( ) { guard let function = function(for: "$s25IssueReportingTestSupport07_recordA0ypyF") else { - #if DEBUG + #if DEBUG && canImport(Darwin) guard let record = unsafeBitCast( symbol: "$s7Testing5IssueV6record_14sourceLocationAcA7CommentVSg_AA06SourceE0VtFZ", @@ -60,7 +60,7 @@ func _recordError( ) { guard let function = function(for: "$s25IssueReportingTestSupport12_recordErrorypyF") else { - #if DEBUG + #if DEBUG && canImport(Darwin) guard let record = unsafeBitCast( symbol: """ @@ -110,7 +110,7 @@ func _withKnownIssue( ) { guard let function = function(for: "$s25IssueReportingTestSupport010_withKnownA0ypyF") else { - #if DEBUG + #if DEBUG && canImport(Darwin) guard let withKnownIssue = unsafeBitCast( symbol: """ @@ -182,7 +182,7 @@ func _withKnownIssue( guard let function = function(for: "$s25IssueReportingTestSupport010_withKnownA13AsyncIsolatedypyF") else { - #if DEBUG + #if DEBUG && canImport(Darwin) guard let withKnownIssue = unsafeBitCast( symbol: """ @@ -254,7 +254,7 @@ func _withKnownIssue( ) async { guard let function = function(for: "$s25IssueReportingTestSupport010_withKnownA5AsyncypyF") else { - #if DEBUG + #if DEBUG && canImport(Darwin) guard let withKnownIssue = unsafeBitCast( symbol: """