Skip to content

Commit

Permalink
ci: add puppeteer regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
krichprollsch committed Feb 17, 2025
1 parent d8fae5b commit bcedbc8
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions .github/workflows/zig-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -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"

0 comments on commit bcedbc8

Please sign in to comment.