Add tests for wasip3 wall_clock and for multiple outstanding wait_for invocations #354
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compile tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build_assemblyscript: | |
name: Build Assemblyscript tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm] | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Initialize node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
- name: Build tests | |
working-directory: tests/assemblyscript | |
run: | | |
./build.py | |
- name: Upload precompiled tests | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: assemblyscript-testsuite | |
path: tests/assemblyscript/testsuite | |
if-no-files-found: error | |
build_rust: | |
name: Build Rust tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm] | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Install nightly wasm32-wasip2 target for Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
target: wasm32-wasip2 | |
- name: Install stable wasm32-wasip1 target for Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
target: wasm32-wasip1 | |
- name: Build tests | |
working-directory: tests/rust | |
run: | | |
./build.py --toolchain=wasm32-wasip3:nightly | |
- name: Upload precompiled tests | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rust-testsuite | |
path: tests/rust/testsuite | |
if-no-files-found: error | |
build_c: | |
name: Build C tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm] | |
env: | |
WASI_VERSION: 27 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Setup WASI SDK download - Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: echo SYSTEM_NAME=x86_64-linux >> $GITHUB_ENV | |
- name: Setup WASI SDK download - MacOS | |
if: matrix.os == 'macos-latest' | |
run: echo SYSTEM_NAME=arm64-macos >> $GITHUB_ENV | |
- name: Setup WASI SDK download - Windows (x86) | |
if: matrix.os == 'windows-latest' | |
run: echo SYSTEM_NAME=x86_64-windows >> $env:GITHUB_ENV | |
- name: Setup WASI SDK download - Windows (ARM) | |
if: matrix.os == 'windows-11-arm' | |
run: echo SYSTEM_NAME=arm64-windows >> $env:GITHUB_ENV | |
- name: Download WASI SDK | |
working-directory: tests/c | |
shell: bash | |
run: curl -L -f https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION}.0-${SYSTEM_NAME}.tar.gz --output wasi-sdk.tar.gz | |
- name: Install WASI SDK | |
working-directory: tests/c | |
shell: bash | |
run: tar xvf wasi-sdk.tar.gz | |
- name: Check formatting | |
if: matrix.os == 'ubuntu-latest' | |
working-directory: tests/c | |
run: find testsuite -regex '.*\.\(c\|h\)' -print0 | xargs -0 -n1 ./wasi-sdk-${WASI_VERSION}.0-${SYSTEM_NAME}/bin/clang-format --style=file --dry-run -Werror | |
- name: Build tests | |
shell: bash | |
working-directory: tests/c | |
run: CC="./wasi-sdk-${WASI_VERSION}.0-${SYSTEM_NAME}/bin/clang" ./build.py | |
- name: Upload precompiled tests | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: c-testsuite | |
path: tests/c/testsuite | |
if-no-files-found: error | |
upload_test_binaries: | |
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} | |
runs-on: ubuntu-latest | |
needs: [build_assemblyscript, build_c, build_rust] | |
strategy: | |
max-parallel: 1 | |
matrix: | |
suite: [assemblyscript, c, rust] | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: prod/testsuite-base | |
- name: Configure git | |
uses: ./.github/actions/git-config | |
- name: Merge main branch changes | |
run: | | |
git merge --no-commit --strategy ours ${{ github.sha }} | |
git checkout --no-overlay ${{ github.sha }} . | |
git checkout HEAD tests/assemblyscript/testsuite | |
git checkout HEAD tests/c/testsuite | |
git checkout HEAD tests/rust/testsuite | |
git diff --quiet || git commit -m "Merge commit ${{ github.sha }} into prod/testsuite-base" | |
- name: Remove existing binaries | |
run: rm -rf tests/${{ matrix.suite }}/testsuite | |
- name: Download ${{ matrix.suite }} test binaries | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ matrix.suite }}-testsuite | |
path: ./tests/${{ matrix.suite }}/testsuite | |
- name: Publish changes to consumer branch | |
shell: bash | |
run: | | |
git add -f tests/${{ matrix.suite }}/testsuite | |
git diff --quiet || git commit -m "Update test binaries for ${{ matrix.suite }} test suite" | |
git push |