From bcedbc845e7f5f0f92d2b0227d51edbe5b96f3a5 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Mon, 17 Feb 2025 16:39:15 +0100 Subject: [PATCH] ci: add puppeteer regression test --- .github/workflows/zig-test.yml | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/zig-test.yml b/.github/workflows/zig-test.yml index ec061993..97d6c014 100644 --- a/.github/workflows/zig-test.yml +++ b/.github/workflows/zig-test.yml @@ -69,9 +69,6 @@ jobs: zig-build-release: name: zig build release - # Don't run the CI on PR - if: github.event_name != 'pull_request' - runs-on: ubuntu-latest steps: @@ -86,6 +83,14 @@ jobs: - name: zig build release run: zig build -Doptimize=ReleaseSafe -Dengine=v8 + - name: upload artifact + uses: actions/upload-artifact@v4 + with: + name: lightpanda-build-release + path: | + zig-out/bin/lightpanda + retention-days: 1 + zig-test: name: zig test @@ -146,6 +151,10 @@ jobs: name: demo-puppeteer needs: zig-build-dev + env: + MAX_MEMORY: 23456 + MAX_AVG_DURATION: 22 + runs-on: ubuntu-latest steps: @@ -159,12 +168,21 @@ jobs: - name: download artifact uses: actions/download-artifact@v4 with: - name: lightpanda-build-dev + name: lightpanda-build-release - run: chmod a+x ./lightpanda - name: run puppeteer run: | - python3 -m http.server 1234 -d ./public & - ./lightpanda & - RUNS=2 npm run bench-puppeteer-cdp + go run ws/main.go & + /usr/bin/time -f'%M' -omrs.out ./lightpanda & + RUNS=100 npm run bench-puppeteer-cdp |tee output + + - name: memory regression + run: | + test "`cat mrs.out`" -le "$MAX_MEMORY" + + - name: duration regression + run: | + test "`cat output|grep 'avg run'|sed 's/avg run duration (ms) //'`" -le "$MAX_AVG_DURATION" +