Skip to content

Commit

Permalink
Merge pull request #268 from swiftwasm/katei/add-swift-6.0-channel
Browse files Browse the repository at this point in the history
Add Swift 6.0 to CI matrix
  • Loading branch information
kateinoigakukun authored Nov 7, 2024
2 parents 64e2e11 + 6b6a5ed commit dd0c977
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 69 deletions.
19 changes: 6 additions & 13 deletions .github/actions/install-swift/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: 'Install Swift toolchain'
description: 'Install Swift toolchain tarball from URL'
inputs:
swift-dir:
description: The directory name part of the distribution URL
required: true
swift-version:
description: Git tag indicating the Swift version
download-url:
description: 'URL to download Swift toolchain tarball'
required: true

runs:
Expand Down Expand Up @@ -33,12 +32,6 @@ runs:
zlib1g-dev
curl
- name: Download Swift
shell: bash
run: curl -fLO https://download.swift.org/${{ inputs.swift-dir }}/${{ inputs.swift-version }}/${{ inputs.swift-version }}-ubuntu22.04.tar.gz
working-directory: ${{ env.RUNNER_TEMP }}

- name: Unarchive and Install Swift
- name: Install Swift
shell: bash
run: sudo tar -xf ${{ inputs.swift-version }}-ubuntu22.04.tar.gz --strip-components=2 -C /usr/local
working-directory: ${{ env.RUNNER_TEMP }}
run: curl -fL ${{ inputs.download-url }} | sudo tar xfz - --strip-components=2 -C /usr/local
36 changes: 23 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,33 @@ jobs:
- { os: ubuntu-20.04, toolchain: wasm-5.9.1-RELEASE, wasi-backend: MicroWASI }
- { os: ubuntu-20.04, toolchain: wasm-5.10.0-RELEASE, wasi-backend: MicroWASI }
- os: ubuntu-22.04
toolchain: DEVELOPMENT-SNAPSHOT-2024-06-13-a
toolchain:
download-url: https://download.swift.org/swift-6.0.2-release/ubuntu2204/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE-ubuntu22.04.tar.gz
swift-sdk:
id: DEVELOPMENT-SNAPSHOT-2024-06-14-a-wasm32-unknown-wasi
download-url: "https://github.com/swiftwasm/swift/releases/download/swift-wasm-DEVELOPMENT-SNAPSHOT-2024-06-14-a/swift-wasm-DEVELOPMENT-SNAPSHOT-2024-06-14-a-wasm32-unknown-wasi.artifactbundle.zip"
id: 6.0.2-RELEASE-wasm32-unknown-wasi
download-url: "https://github.com/swiftwasm/swift/releases/download/swift-wasm-6.0.2-RELEASE/swift-wasm-6.0.2-RELEASE-wasm32-unknown-wasi.artifactbundle.zip"
checksum: "6ffedb055cb9956395d9f435d03d53ebe9f6a8d45106b979d1b7f53358e1dcb4"
wasi-backend: Node
- os: ubuntu-22.04
toolchain: DEVELOPMENT-SNAPSHOT-2024-06-13-a
toolchain:
download-url: https://download.swift.org/development/ubuntu2204/swift-DEVELOPMENT-SNAPSHOT-2024-10-30-a/swift-DEVELOPMENT-SNAPSHOT-2024-10-30-a-ubuntu22.04.tar.gz
swift-sdk:
id: DEVELOPMENT-SNAPSHOT-2024-06-14-a-wasm32-unknown-wasip1-threads
download-url: "https://github.com/swiftwasm/swift/releases/download/swift-wasm-DEVELOPMENT-SNAPSHOT-2024-06-14-a/swift-wasm-DEVELOPMENT-SNAPSHOT-2024-06-14-a-wasm32-unknown-wasip1-threads.artifactbundle.zip"
id: DEVELOPMENT-SNAPSHOT-2024-10-31-a-wasm32-unknown-wasi
download-url: "https://github.com/swiftwasm/swift/releases/download/swift-wasm-DEVELOPMENT-SNAPSHOT-2024-10-31-a/swift-wasm-DEVELOPMENT-SNAPSHOT-2024-10-31-a-wasm32-unknown-wasi.artifactbundle.zip"
checksum: "e42546397786ea6eaec2d9c07f9118a6f3428784cf3df3840a369f19700c1a69"
wasi-backend: Node
- os: ubuntu-22.04
toolchain:
download-url: https://download.swift.org/development/ubuntu2204/swift-DEVELOPMENT-SNAPSHOT-2024-10-30-a/swift-DEVELOPMENT-SNAPSHOT-2024-10-30-a-ubuntu22.04.tar.gz
swift-sdk:
id: DEVELOPMENT-SNAPSHOT-2024-10-31-a-wasm32-unknown-wasip1-threads
download-url: "https://github.com/swiftwasm/swift/releases/download/swift-wasm-DEVELOPMENT-SNAPSHOT-2024-10-31-a/swift-wasm-DEVELOPMENT-SNAPSHOT-2024-10-31-a-wasm32-unknown-wasip1-threads.artifactbundle.zip"
checksum: "17dbbe61af6ca09c92ee2d68a56d5716530428e28c4c8358aa860cc4fcdc91ae"
wasi-backend: Node

runs-on: ${{ matrix.entry.os }}
env:
JAVASCRIPTKIT_WASI_BACKEND: ${{ matrix.entry.wasi-backend }}
SWIFT_VERSION: ${{ matrix.entry.toolchain }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -52,12 +63,11 @@ jobs:
- uses: ./.github/actions/install-swift
if: ${{ matrix.entry.swift-sdk }}
with:
swift-dir: development/ubuntu2204
swift-version: swift-${{ matrix.entry.toolchain }}
download-url: ${{ matrix.entry.toolchain.download-url }}
- name: Install Swift SDK
if: ${{ matrix.entry.swift-sdk }}
run: |
swift sdk install "${{ matrix.entry.swift-sdk.download-url }}"
swift sdk install "${{ matrix.entry.swift-sdk.download-url }}" --checksum "${{ matrix.entry.swift-sdk.checksum }}"
echo "SWIFT_SDK_ID=${{ matrix.entry.swift-sdk.id }}" >> $GITHUB_ENV
- run: make bootstrap
- run: make test
Expand Down Expand Up @@ -94,11 +104,11 @@ jobs:
matrix:
entry:
- os: ubuntu-22.04
toolchain: DEVELOPMENT-SNAPSHOT-2024-09-25-a
toolchain:
download-url: https://download.swift.org/development/ubuntu2204/swift-DEVELOPMENT-SNAPSHOT-2024-10-30-a/swift-DEVELOPMENT-SNAPSHOT-2024-10-30-a-ubuntu22.04.tar.gz
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-swift
with:
swift-dir: development/ubuntu2204
swift-version: swift-${{ matrix.entry.toolchain }}
download-url: ${{ matrix.entry.toolchain.download-url }}
- run: ./Examples/Embedded/build.sh
2 changes: 1 addition & 1 deletion IntegrationTests/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const startWasiTask = async (wasmPath, wasiConstructorKey = selectWASIBac
// We don't have JS API to get memory descriptor of imported memory
// at this moment, so we assume 256 pages (16MB) memory is enough
// large for initial memory size.
const memory = new WebAssembly.Memory({ initial: 256, maximum: 16384, shared: true })
const memory = new WebAssembly.Memory({ initial: 1024, maximum: 16384, shared: true })
importObject["env"] = { memory };
importObject["wasi"] = {
"thread-spawn": (startArg) => {
Expand Down
3 changes: 3 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ let package = Package(
"JavaScriptEventLoop",
"JavaScriptKit",
"JavaScriptEventLoopTestSupport",
],
swiftSettings: [
.enableExperimentalFeature("Extern")
]
),
.target(name: "_CJavaScriptEventLoop"),
Expand Down
42 changes: 0 additions & 42 deletions scripts/install-toolchain.sh

This file was deleted.

0 comments on commit dd0c977

Please sign in to comment.