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