Skip to content

Commit d429820

Browse files
committed
ci: throwaway mac snapshot timing
1 parent a04b45a commit d429820

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: dscan-snap-mac
2+
on:
3+
push:
4+
branches: [ci/dscan-snap-mac]
5+
jobs:
6+
snap:
7+
runs-on: macos-15
8+
timeout-minutes: 30
9+
steps:
10+
- uses: actions/setup-node@v4
11+
with:
12+
node-version: 24
13+
- name: project
14+
run: |
15+
brew list ffmpeg >/dev/null 2>&1 || brew install ffmpeg >/dev/null 2>&1
16+
mkdir proj && cd proj
17+
echo '{}' > hyperframes.json
18+
ffmpeg -v error -y -f lavfi -i "testsrc2=size=1280x720:rate=30" -t 8 -pix_fmt yuv420p clip.mp4
19+
cat > index.html <<'H'
20+
<!doctype html><html><head><meta charset="utf-8"></head><body style="margin:0;background:#101820">
21+
<div id="root" data-composition-id="main" data-start="0" data-duration="8" data-width="1280" data-height="720">
22+
<video id="v" src="clip.mp4" data-start="0" data-duration="8" data-track-index="0" muted playsinline></video>
23+
<div style="position:absolute;left:80px;top:60px;font:72px Arial;color:#fff">Static title</div>
24+
</div>
25+
<script src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/gsap.min.js"></script>
26+
<script>window.__timelines=window.__timelines||{};window.__timelines["main"]=gsap.timeline({paused:true});</script>
27+
</body></html>
28+
H
29+
npx -y hyperframes@0.8.219 browser ensure 2>&1 | tail -n 3
30+
- name: time default vs software
31+
run: |
32+
cd proj
33+
t() { s=$(date +%s.%N 2>/dev/null || python3 -c 'import time;print(time.time())'); "$@" >/dev/null 2>&1; e=$(python3 -c 'import time;print(time.time())'); python3 -c "import sys;print('%.1f' % (float('$e')-float('$s')))"; }
34+
python3 - <<'P'
35+
import subprocess,time
36+
def run(label,args):
37+
out=[]
38+
for i in range(3):
39+
s=time.time(); r=subprocess.run(["npx","-y","hyperframes@0.8.219","snapshot","--at","1,3,5","--no-end","--describe","false","-o","shots_"+label]+args,capture_output=True,text=True); out.append(round(time.time()-s,1))
40+
print(label,out,"exit",r.returncode)
41+
run("default",[])
42+
run("software",["--no-browser-gpu"])
43+
run("default2",[])
44+
run("software2",["--no-browser-gpu"])
45+
P

0 commit comments

Comments
 (0)