From 37350b07018244140c1a371f2cd63727a646d4f7 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Mon, 8 Apr 2024 17:59:46 +0200 Subject: [PATCH] ci: save and export browser bench --- .github/workflows/zig-test.yml | 38 +++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) 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