Skip to content

Commit 73dbb2f

Browse files
authored
Refactor installation of wasmtime/wasm-tools on CI (#387)
* 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. * Change the directory of the adapter * Update descriptions
1 parent c2f9c10 commit 73dbb2f

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

.github/workflows/main.yml

+11-16
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,16 @@ jobs:
3838
restore-keys: |
3939
0-cache-macos-latest
4040
if: matrix.os == 'macos-latest'
41-
- name: Install wasmtime for tests
42-
# TODO: switch to Wasmtime 17 once it's released, which will include https://github.com/bytecodealliance/wasmtime/pull/7750
43-
run: |
44-
curl -f -L --retry 5 https://wasmtime.dev/install.sh | bash -s -- --version dev
45-
~/.wasmtime/bin/wasmtime --version
46-
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
47-
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
48-
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
49-
tar xf wasm-tools-1.0.54-x86_64-linux.tar.gz
50-
cp wasm-tools-1.0.54-x86_64-linux/wasm-tools ~/.wasmtime/bin/
51-
else
52-
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
53-
tar xf wasm-tools-1.0.54-x86_64-macos.tar.gz
54-
cp wasm-tools-1.0.54-x86_64-macos/wasm-tools ~/.wasmtime/bin/
55-
fi
41+
- name: Setup `wasmtime` for tests
42+
uses: bytecodealliance/actions/wasmtime/setup@v1
43+
with:
44+
version: "18.0.2"
45+
- name: Setup `wasm-tools` for tests
46+
uses: bytecodealliance/actions/wasm-tools/setup@v1
47+
with:
48+
version: "1.201.0"
49+
- name: Download command adapter for tests
50+
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
5651
- uses: actions/checkout@v3
5752
with:
5853
fetch-depth: 0
@@ -72,7 +67,7 @@ jobs:
7267
run: NINJA_FLAGS=-v make package LLVM_CMAKE_FLAGS=-DLLVM_CCACHE_BUILD=ON
7368
shell: bash
7469
- name: Run the testsuite
75-
run: NINJA_FLAGS=-v make check RUNTIME=~/.wasmtime/bin/wasmtime ADAPTER=~/.wasmtime/bin/wasi_snapshot_preview1.command.wasm WASM_TOOLS=~/.wasmtime/bin/wasm-tools
70+
run: NINJA_FLAGS=-v make check RUNTIME=wasmtime ADAPTER=${{ runner.temp }}/wasi_snapshot_preview1.command.wasm WASM_TOOLS=wasm-tools
7671
- name: Upload artifacts
7772
uses: actions/upload-artifact@v1
7873
with:

0 commit comments

Comments
 (0)