Skip to content

Commit fa00c0c

Browse files
committed
Attempt to add on-PR CI for Wasmtime on Windows, Ubuntu
1 parent 2e683c8 commit fa00c0c

File tree

3 files changed

+78
-1
lines changed

3 files changed

+78
-1
lines changed

.github/workflows/compile-tests.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,81 @@ jobs:
131131
if-no-files-found: error
132132
include-hidden-files: true
133133

134+
run_tests:
135+
name: Run tests
136+
runs-on: ${{ matrix.os }}
137+
needs: [build_assemblyscript, build_c, build_rust]
138+
env:
139+
WASMTIME_VERSION: 37.0.1
140+
strategy:
141+
matrix:
142+
os: [ubuntu-latest, windows-latest, macos-latest, windows-11-arm]
143+
runtime: [wasmtime]
144+
steps:
145+
- name: Check out repository code
146+
uses: actions/checkout@v3
147+
with:
148+
fetch-depth: 0
149+
ref: ${{ github.sha }}
150+
151+
- name: Initialize Python environment
152+
uses: actions/setup-python@v4
153+
with:
154+
python-version: '3.12'
155+
cache: pip
156+
157+
- name: Install dependencies
158+
working-directory: test-runner
159+
run: pip install -r requirements.txt
160+
161+
- name: Install wasmtime
162+
if: matrix.runtime == 'wasmtime' && matrix.os == 'windows-latest'
163+
run: |
164+
$url = "https://github.com/bytecodealliance/wasmtime/releases/download/v$env:WASMTIME_VERSION/wasmtime-v$env:WASMTIME_VERSION-x86_64-windows.zip"
165+
Write-Host "URL: $url"
166+
Invoke-WebRequest -Uri $url -OutFile "wasmtime.zip"
167+
Expand-Archive -Path "wasmtime.zip" -DestinationPath "."
168+
echo "$env:GITHUB_WORKSPACE\wasmtime-v$env:WASMTIME_VERSION-x86_64-windows" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
169+
170+
- name: Install wasmtime
171+
if: matrix.runtime == 'wasmtime' && matrix.os == 'windows-11-arm'
172+
run: |
173+
$url = "https://github.com/bytecodealliance/wasmtime/releases/download/v$env:WASMTIME_VERSION/wasmtime-v$env:WASMTIME_VERSION-aarch64-windows.zip"
174+
Write-Host "URL: $url"
175+
Invoke-WebRequest -Uri $url -OutFile "wasmtime.zip"
176+
Expand-Archive -Path "wasmtime.zip" -DestinationPath "."
177+
echo "$env:GITHUB_WORKSPACE\wasmtime-v$env:WASMTIME_VERSION-aarch64-windows" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
178+
179+
- name: Install wasmtime
180+
if: matrix.runtime == 'wasmtime' && (matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest')
181+
run: |
182+
set -e
183+
curl https://wasmtime.dev/install.sh -sSf | bash -s -- --version $WASMTIME_VERSION
184+
echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH
185+
186+
- name: Download Rust test binaries
187+
uses: actions/download-artifact@v4
188+
with:
189+
name: rust-testsuite
190+
path: ./tests/rust/testsuite
191+
192+
- name: Download C test binaries
193+
uses: actions/download-artifact@v4
194+
with:
195+
name: c-testsuite
196+
path: ./tests/c/testsuite
197+
198+
- name: Download AssemblyScript test binaries
199+
uses: actions/download-artifact@v4
200+
with:
201+
name: assemblyscript-testsuite
202+
path: ./tests/assemblyscript/testsuite
203+
204+
- name: Run tests
205+
continue-on-error: true
206+
run: |
207+
python run-tests --verbose --runtime adapters/${{ matrix.runtime }}.py
208+
134209
upload_test_binaries:
135210
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
136211
runs-on: ubuntu-latest

run-tests

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,5 @@ else:
8888
sys.exit(run_tests(runtime_adapters, test_suite,
8989
color=not options.disable_colors,
9090
json_log_file=options.json_output_location,
91+
verbose=options.verbose,
9192
exclude_filters=options.exclude_filter))

test-runner/wasi_test_runner/harness.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ def run_tests(runtimes: List[RuntimeAdapter],
1616
test_suite_paths: List[Path],
1717
exclude_filters: List[Path] | None = None,
1818
color: bool = True,
19+
verbose: bool = False,
1920
json_log_file: str | None = None) -> int:
2021
validators: List[Validator] = [exit_code_validator, stdout_validator]
21-
reporters: List[TestReporter] = [ConsoleTestReporter(color)]
22+
reporters: List[TestReporter] = [ConsoleTestReporter(color, verbose=verbose)]
2223
if json_log_file:
2324
reporters.append(JSONTestReporter(json_log_file))
2425
filters: List[TestFilter] = [UnsupportedWasiTestExcludeFilter()]

0 commit comments

Comments
 (0)