Skip to content

Commit bcedbc8

Browse files
committed
ci: add puppeteer regression test
1 parent d8fae5b commit bcedbc8

1 file changed

Lines changed: 25 additions & 7 deletions

File tree

.github/workflows/zig-test.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ jobs:
6969
zig-build-release:
7070
name: zig build release
7171

72-
# Don't run the CI on PR
73-
if: github.event_name != 'pull_request'
74-
7572
runs-on: ubuntu-latest
7673

7774
steps:
@@ -86,6 +83,14 @@ jobs:
8683
- name: zig build release
8784
run: zig build -Doptimize=ReleaseSafe -Dengine=v8
8885

86+
- name: upload artifact
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: lightpanda-build-release
90+
path: |
91+
zig-out/bin/lightpanda
92+
retention-days: 1
93+
8994
zig-test:
9095
name: zig test
9196

@@ -146,6 +151,10 @@ jobs:
146151
name: demo-puppeteer
147152
needs: zig-build-dev
148153

154+
env:
155+
MAX_MEMORY: 23456
156+
MAX_AVG_DURATION: 22
157+
149158
runs-on: ubuntu-latest
150159

151160
steps:
@@ -159,12 +168,21 @@ jobs:
159168
- name: download artifact
160169
uses: actions/download-artifact@v4
161170
with:
162-
name: lightpanda-build-dev
171+
name: lightpanda-build-release
163172

164173
- run: chmod a+x ./lightpanda
165174

166175
- name: run puppeteer
167176
run: |
168-
python3 -m http.server 1234 -d ./public &
169-
./lightpanda &
170-
RUNS=2 npm run bench-puppeteer-cdp
177+
go run ws/main.go &
178+
/usr/bin/time -f'%M' -omrs.out ./lightpanda &
179+
RUNS=100 npm run bench-puppeteer-cdp |tee output
180+
181+
- name: memory regression
182+
run: |
183+
test "`cat mrs.out`" -le "$MAX_MEMORY"
184+
185+
- name: duration regression
186+
run: |
187+
test "`cat output|grep 'avg run'|sed 's/avg run duration (ms) //'`" -le "$MAX_AVG_DURATION"
188+

0 commit comments

Comments
 (0)