diff --git a/.github/workflows/zig-test.yml b/.github/workflows/zig-test.yml index a23b9bc7..807d4bf2 100644 --- a/.github/workflows/zig-test.yml +++ b/.github/workflows/zig-test.yml @@ -71,7 +71,43 @@ jobs: run: zig build -Dengine=v8 - name: zig build test - run: zig build test -Dengine=v8 + run: zig build test -Dengine=v8 -- --json > bench.json - name: zig build release run: zig build -Doptimize=ReleaseSafe -Dengine=v8 + + - name: write commit + run: | + echo "${{github.sha}}" > commit.txt + + - name: upload artifact + uses: actions/upload-artifact@v3 + with: + name: bench-results + path: | + bench.json + commit.txt + retention-days: 10 + + bench-fmt: + name: perf-fmt + needs: zig-test + + # Don't execute on PR + if: github.event_name != 'pull_request' + + runs-on: ubuntu-latest + container: + image: ghcr.io/lightpanda-io/perf-fmt:latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: download artifact + uses: actions/download-artifact@v3 + with: + name: bench-results + + - name: format and send json result + run: /perf-fmt bench-browser ${{ github.sha }} bench.json