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

Fix Wasm CI #130

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,26 @@ jobs:
run: make test-linux SWIFT_VERSION=${{ matrix.swift }}

wasm:
name: SwiftWasm
runs-on: ubuntu-latest
name: Wasm
runs-on: macos-14
strategy:
matrix:
toolchain:
- wasm-DEVELOPMENT-SNAPSHOT-2024-07-08-a
steps:
- uses: actions/checkout@v4
- uses: bytecodealliance/actions/wasmtime/setup@v1
- uses: swiftwasm/setup-swiftwasm@v1
- name: Cache toolchains
uses: actions/cache@v3
with:
swift-version: "wasm-5.9.2-RELEASE"
- name: Build tests
run: swift build --triple wasm32-unknown-wasi --build-tests
- name: Run tests
run: wasmtime .build/debug/swift-custom-dumpPackageTests.wasm
path: |
~/Library/Developer/Toolchains
key: ${{ matrix.toolchain }}
- uses: actions/checkout@v4
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_15.4.app
- name: Select Swift version
run: echo '${{ matrix.toolchain }}' > .swift-version
- name: Build
run: swift run carton bundle --debug

windows:
name: Windows
Expand Down
14 changes: 14 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,17 @@ let package = Package(
),
]
)

#if os(macOS)
package.dependencies.append(contentsOf: [
.package(url: "https://github.com/swiftwasm/carton", from: "1.0.0"),
])
package.targets.append(
.executableTarget(
name: "WasmTests",
dependencies: [
"CustomDump"
]
)
)
#endif
14 changes: 14 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,17 @@ let package = Package(
),
]
)

#if os(macOS)
package.dependencies.append(contentsOf: [
.package(url: "https://github.com/swiftwasm/carton", from: "1.0.0"),
])
package.targets.append(
.executableTarget(
name: "WasmTests",
dependencies: [
"CustomDump"
]
)
)
#endif
3 changes: 3 additions & 0 deletions Sources/WasmTests/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import CustomDump

customDump("Hello, world!")
Loading