From 1ca93a0da335fe7994f3f9e5c543c8bdf644991d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 2 Mar 2024 12:17:06 -0800 Subject: [PATCH 1/3] Refactor installation of wasmtime/wasm-tools on CI We've got official actions for installation Wasmtime and wasm-tools in the bytecodealliance organization which should help make this installation step a bit more readable. --- .github/workflows/main.yml | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e50929b08..b6e20d4cb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,21 +38,16 @@ jobs: restore-keys: | 0-cache-macos-latest if: matrix.os == 'macos-latest' - - name: Install wasmtime for tests - # TODO: switch to Wasmtime 17 once it's released, which will include https://github.com/bytecodealliance/wasmtime/pull/7750 - run: | - curl -f -L --retry 5 https://wasmtime.dev/install.sh | bash -s -- --version dev - ~/.wasmtime/bin/wasmtime --version - curl -f -L --retry 5 -o ~/.wasmtime/bin/wasi_snapshot_preview1.command.wasm https://github.com/bytecodealliance/wasmtime/releases/download/dev/wasi_snapshot_preview1.command.wasm - if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then - curl -f -OL --retry 5 https://github.com/bytecodealliance/wasm-tools/releases/download/wasm-tools-1.0.54/wasm-tools-1.0.54-x86_64-linux.tar.gz - tar xf wasm-tools-1.0.54-x86_64-linux.tar.gz - cp wasm-tools-1.0.54-x86_64-linux/wasm-tools ~/.wasmtime/bin/ - else - curl -f -OL --retry 5 https://github.com/bytecodealliance/wasm-tools/releases/download/wasm-tools-1.0.54/wasm-tools-1.0.54-x86_64-macos.tar.gz - tar xf wasm-tools-1.0.54-x86_64-macos.tar.gz - cp wasm-tools-1.0.54-x86_64-macos/wasm-tools ~/.wasmtime/bin/ - fi + - name: Setup `wasmtime` + uses: bytecodealliance/actions/wasmtime/setup@v1 + with: + version: "18.0.2" + - name: Setup `wasm-tools` + uses: bytecodealliance/actions/wasm-tools/setup@v1 + with: + version: "1.201.0" + - name: Download latest command adapter + run: curl -f -L --retry 5 -o ~/.wasmtime/bin/wasi_snapshot_preview1.command.wasm https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.2/wasi_snapshot_preview1.command.wasm - uses: actions/checkout@v3 with: fetch-depth: 0 From 1f725f1200b3460753bae35c0ab384894d815e10 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 2 Mar 2024 13:19:41 -0800 Subject: [PATCH 2/3] Change the directory of the adapter --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b6e20d4cb..8ae44a98d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,7 +47,7 @@ jobs: with: version: "1.201.0" - name: Download latest command adapter - run: curl -f -L --retry 5 -o ~/.wasmtime/bin/wasi_snapshot_preview1.command.wasm https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.2/wasi_snapshot_preview1.command.wasm + run: curl -f -L --retry 5 -o ${{ runner.temp }}/wasi_snapshot_preview1.command.wasm https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.2/wasi_snapshot_preview1.command.wasm - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -67,7 +67,7 @@ jobs: run: NINJA_FLAGS=-v make package LLVM_CMAKE_FLAGS=-DLLVM_CCACHE_BUILD=ON shell: bash - name: Run the testsuite - run: NINJA_FLAGS=-v make check RUNTIME=~/.wasmtime/bin/wasmtime ADAPTER=~/.wasmtime/bin/wasi_snapshot_preview1.command.wasm WASM_TOOLS=~/.wasmtime/bin/wasm-tools + run: NINJA_FLAGS=-v make check RUNTIME=wasmtime ADAPTER=${{ runner.temp }}/wasi_snapshot_preview1.command.wasm WASM_TOOLS=wasm-tools - name: Upload artifacts uses: actions/upload-artifact@v1 with: From e9fe0baae5e48473aeb6da0d8489f9179e73fa84 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 6 Mar 2024 11:19:53 -0800 Subject: [PATCH 3/3] Update descriptions --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ae44a98d..17ab9885e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,15 +38,15 @@ jobs: restore-keys: | 0-cache-macos-latest if: matrix.os == 'macos-latest' - - name: Setup `wasmtime` + - name: Setup `wasmtime` for tests uses: bytecodealliance/actions/wasmtime/setup@v1 with: version: "18.0.2" - - name: Setup `wasm-tools` + - name: Setup `wasm-tools` for tests uses: bytecodealliance/actions/wasm-tools/setup@v1 with: version: "1.201.0" - - name: Download latest command adapter + - name: Download command adapter for tests run: curl -f -L --retry 5 -o ${{ runner.temp }}/wasi_snapshot_preview1.command.wasm https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.2/wasi_snapshot_preview1.command.wasm - uses: actions/checkout@v3 with: