Skip to content

Commit 8812974

Browse files
committed
wasm
1 parent d81e9cd commit 8812974

File tree

7 files changed

+36
-18
lines changed

7 files changed

+36
-18
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,13 @@ jobs:
4242

4343
wasm:
4444
name: Wasm
45-
runs-on: ubuntu-latest
45+
runs-on: macos-14
4646
steps:
4747
- uses: actions/checkout@v4
48-
- uses: bytecodealliance/actions/wasmtime/setup@v1
49-
- uses: swiftwasm/setup-swiftwasm@v1
50-
with:
51-
swift-version: "wasm-5.9.2-RELEASE"
52-
- name: Build tests
53-
run: swift build --triple wasm32-unknown-wasi --build-tests
54-
- name: Run tests
55-
run: wasmtime --dir . .build/debug/swift-issue-reportingPackageTests.wasm
48+
- name: Select Swift version
49+
run: echo 'wasm-DEVELOPMENT-SNAPSHOT-2024-07-08-a' > .swift-version
50+
- name: Build
51+
run: swift run carton bundle
5652

5753
windows:
5854
name: Windows

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/.swiftpm
44
/archives/
55
/xcframeworks/
6+
/Bundle
67
/Packages
78
/*.xcodeproj
89
xcuserdata/

Package.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,16 @@ let package = Package(
5555
#endif
5656

5757
#if os(macOS)
58-
package.dependencies.append(
59-
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
58+
package.dependencies.append(contentsOf: [
59+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
60+
.package(url: "https://github.com/swiftwasm/carton", from: "1.0.0"),
61+
])
62+
package.targets.append(
63+
.executableTarget(
64+
name: "WasmTests",
65+
dependencies: [
66+
"IssueReporting"
67+
]
68+
)
6069
)
6170
#endif

Package@swift-6.0.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,16 @@ let package = Package(
5959
#endif
6060

6161
#if os(macOS)
62-
package.dependencies.append(
63-
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
62+
package.dependencies.append(contentsOf: [
63+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
64+
.package(url: "https://github.com/swiftwasm/carton", from: "1.0.0"),
65+
])
66+
package.targets.append(
67+
.executableTarget(
68+
name: "WasmTests",
69+
dependencies: [
70+
"IssueReporting"
71+
]
72+
)
6473
)
6574
#endif

Sources/IssueReportingTestSupport/SwiftTesting.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import Testing
33
#endif
44

5-
#if !os(Windows)
5+
#if !os(WASI) && !os(Windows)
66
@_cdecl("IssueReportingTestSupport_RecordIssue")
77
#endif
88
public func _recordIssue() -> Any { __recordIssue }
@@ -40,7 +40,7 @@ private func __recordIssue(
4040
#endif
4141
}
4242

43-
#if !os(Windows)
43+
#if !os(WASI) && !os(Windows)
4444
@_cdecl("IssueReportingTestSupport_WithKnownIssue")
4545
#endif
4646
public func _withKnownIssue() -> Any { __withKnownIssue }
@@ -54,7 +54,7 @@ private func __withKnownIssue(
5454
#endif
5555
}
5656

57-
#if !os(Windows)
57+
#if !os(WASI) && !os(Windows)
5858
@_cdecl("IssueReportingTestSupport_CurrentTestIsNotNil")
5959
#endif
6060
public func _currentTestIsNotNil() -> Any { __currentTestIsNotNil }

Sources/IssueReportingTestSupport/XCTest.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import XCTest
33
#endif
44

5-
#if !os(Windows)
5+
#if !os(WASI) && !os(Windows)
66
@_cdecl("IssueReportingTestSupport_XCTFail")
77
#endif
88
public func _XCTFail() -> Any { __XCTFail }
@@ -12,7 +12,7 @@ private func __XCTFail(_ message: String, file: StaticString, line: UInt) {
1212
#endif
1313
}
1414

15-
#if !os(Windows)
15+
#if !os(WASI) && !os(Windows)
1616
@_cdecl("IssueReportingTestSupport_XCTExpectFailure")
1717
#endif
1818
public func _XCTExpectFailure() -> Any { __XCTExpectFailure }

Sources/WasmTests/main.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import IssueReporting
2+
3+
reportIssue()

0 commit comments

Comments
 (0)