Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Wasm CI. #192

Merged
merged 19 commits into from
Aug 29, 2024
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,30 @@ jobs:
- name: Run tests (release)
run: swift test -c release --parallel

wasm:
name: SwiftWasm
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- wasm-5.9.2-RELEASE
- wasm-5.10.0-RELEASE
steps:
- name: Cache toolchains
uses: actions/cache@v3
with:
path: ~/Library/Developer/Toolchains
key: ${{ matrix.toolchain }}
- uses: actions/checkout@v4
- uses: bytecodealliance/actions/wasmtime/setup@v1
- uses: swiftwasm/setup-swiftwasm@v1
with:
swift-version: ${{ matrix.toolchain }}
- name: Build tests
run: swift build --triple wasm32-unknown-wasi --build-tests -Xlinker -z -Xlinker stack-size=$((1024 * 1024))
- name: Run tests
run: wasmtime .build/debug/swift-case-pathsPackageTests.wasm

# windows:
# name: Windows (Swift ${{ matrix.swift }}, ${{ matrix.config }})
# strategy:
Expand Down
16 changes: 15 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,21 @@ let package = Package(
name: "CasePathsMacrosTests",
dependencies: [
"CasePathsMacros",
.product(name: "MacroTesting", package: "swift-macro-testing"),
.product(
name: "MacroTesting",
package: "swift-macro-testing",
condition: .when(
platforms: [
.iOS,
.linux,
.macCatalyst,
.macOS,
.tvOS,
.watchOS,
.windows,
]
)
),
]
),
]
Expand Down
16 changes: 15 additions & 1 deletion [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,21 @@ let package = Package(
name: "CasePathsMacrosTests",
dependencies: [
"CasePathsMacros",
.product(name: "MacroTesting", package: "swift-macro-testing"),
.product(
name: "MacroTesting",
package: "swift-macro-testing",
condition: .when(
platforms: [
.iOS,
.linux,
.macCatalyst,
.macOS,
.tvOS,
.watchOS,
.windows,
]
)
),
]
),
],
Expand Down
2 changes: 2 additions & 0 deletions Tests/CasePathsMacrosTests/CasePathableMacroTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(MacroTesting)
import CasePathsMacros
import MacroTesting
import SwiftSyntaxMacros
Expand Down Expand Up @@ -1294,3 +1295,4 @@ final class CasePathableMacroTests: XCTestCase {
}
}
}
#endif
Loading