diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d6b91d..af50875 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Package.swift b/Package.swift index 5c2d702..763e7bf 100644 --- a/Package.swift +++ b/Package.swift @@ -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 diff --git a/Package@swift-6.0.swift b/Package@swift-6.0.swift index af27ad9..eb8222b 100644 --- a/Package@swift-6.0.swift +++ b/Package@swift-6.0.swift @@ -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 diff --git a/Sources/WasmTests/main.swift b/Sources/WasmTests/main.swift new file mode 100644 index 0000000..415aa30 --- /dev/null +++ b/Sources/WasmTests/main.swift @@ -0,0 +1,3 @@ +import CustomDump + +customDump("Hello, world!")