mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
ci: add puppeteer regression test
This commit is contained in:
32
.github/workflows/zig-test.yml
vendored
32
.github/workflows/zig-test.yml
vendored
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user