diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index bc3df26818c..9ed44bbb890 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -111,6 +111,59 @@ jobs: - name: Run the test binary with wazero CLI run: wazero run -mount=:/ ./zigbin/test.wasm + zig-opt: + needs: build_zig_test_binary + name: Zig / Optimizing Compiler + runs-on: ubuntu-22.04 + strategy: + fail-fast: false # don't fail fast as sometimes failures are arch/OS specific + matrix: + arch: + - "arm64" + + steps: + - name: Checkout wazero + uses: actions/checkout@v3 + + - uses: actions/cache@v3 + id: binary-cache + with: + # Use share the cache containing archives across OSes. + enableCrossOsArchive: true + # We need this cache to run tests. + fail-on-cache-miss: true + key: zig-stdlib-test-binary-${{ env.ZIG_VERSION }} + path: + ./zigbin/ + + - uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Build wazero + run: go build -o ./wazerocli ./cmd/wazero + env: + GOARCH: ${{ matrix.arch }} + + - name: Set up QEMU + if: ${{ matrix.arch != 'amd64' }} + uses: docker/setup-qemu-action@v2 + with: # Avoid docker.io rate-limits; built with internal-images.yml + image: ghcr.io/tetratelabs/wazero/internal-binfmt + platforms: ${{ matrix.arch }} + + - name: Build scratch container + run: | + echo 'FROM scratch' >> Dockerfile + echo 'CMD ["/test"]' >> Dockerfile + docker buildx build -t wazero:test --platform linux/${{ matrix.arch }} . + + - name: Run built test binaries + # This runs all tests compiled above in sequence. Note: This mounts /tmp to allow t.TempDir() in tests. + run: | + docker run --platform linux/${{ matrix.arch }} -v $(pwd)/zigbin:/test -v $(pwd)/wazerocli:/wazero -e WAZEROCLI=/wazero --tmpfs /tmp --rm -t wazero:test \ + /wazero run -optimizing-compiler -mount=:/ ./test/test.wasm + build_tinygo_test_binary: name: Build TinyGo test binary runs-on: ubuntu-22.04 @@ -235,6 +288,63 @@ jobs: wazero run -mount=:/ -mount=:/tmp $bin -- -test.v done + tinygo-opt: + needs: build_tinygo_test_binary + name: TinyGo / Optimizing Compiler + runs-on: ubuntu-22.04 + strategy: + fail-fast: false # don't fail fast as sometimes failures are arch/OS specific + matrix: + arch: + - "arm64" + + steps: + - name: Checkout wazero + uses: actions/checkout@v3 + + - uses: actions/cache@v3 + id: binary-cache + with: + # Use share the cache containing archives across OSes. + enableCrossOsArchive: true + # We need this cache to run tests. + fail-on-cache-miss: true + key: tinygo-test-binaries-${{ env.TINYGO_VERSION }} + path: + ./tinygobin/ + + - uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Build wazero + run: go build -o ./wazerocli ./cmd/wazero + env: + GOARCH: ${{ matrix.arch }} + + - name: Set up QEMU + if: ${{ matrix.arch != 'amd64' }} + uses: docker/setup-qemu-action@v2 + with: # Avoid docker.io rate-limits; built with internal-images.yml + image: ghcr.io/tetratelabs/wazero/internal-binfmt + platforms: ${{ matrix.arch }} + + - name: Build scratch container + run: | + echo 'FROM scratch' >> Dockerfile + echo 'CMD ["/test"]' >> Dockerfile + docker buildx build -t wazero:test --platform linux/${{ matrix.arch }} . + + - name: Run built test binaries + # This runs all tests compiled above in sequence. Note: This mounts /tmp to allow t.TempDir() in tests. + run: | + cd ./tinygobin + for bin in *.test; do + echo $bin + docker run --platform linux/${{ matrix.arch }} -v $(pwd)/zigbin:/test -v $(pwd)/wazerocli:/wazero -e WAZEROCLI=/wazero --tmpfs /tmp --rm -t wazero:test \ + /wazero run -optimizing-compiler -mount=:/ $bin -- -test.v + done + wasi-testsuite: name: wasi-testsuite runs-on: ${{ matrix.os }}