Skip to content

Commit fd6265c

Browse files
committed
ci: add smoke test and improve pandas benchmark
- Add smoke test step before benchmarks to catch pyhl run failures early - Add explicit pandas smoke check before timing loop - Redirect stdout to /dev/null in timing runs to isolate timing output Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 0306cc3 commit fd6265c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/benchmarks.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ jobs:
170170
if: steps.kvm_check.outputs.available == 'true'
171171
run: pyhl setup --from src-dir --force
172172

173+
- name: "Smoke: verify pyhl run works"
174+
if: steps.kvm_check.outputs.available == 'true'
175+
run: |
176+
echo "--- snapshot and system info ---"
177+
ls -lh .pyhl/
178+
free -h
179+
echo "--- smoke test ---"
180+
pyhl run -c "print('smoke ok')" || { echo "FAIL: pyhl run exited $?"; exit 1; }
181+
173182
- name: "Perf: hello world (15 runs)"
174183
if: steps.kvm_check.outputs.available == 'true'
175184
run: |
@@ -210,9 +219,10 @@ jobs:
210219
df = pd.DataFrame(np.random.randn(1000, 4), columns=list('ABCD'))
211220
print(df.describe())
212221
PYEOF
222+
pyhl run /tmp/pandas_bench.py > /dev/null || { echo "FAIL: pandas smoke check failed"; exit 1; }
213223
times=()
214224
for i in $(seq 1 10); do
215-
ms=$( { /usr/bin/time -f "%e" pyhl run /tmp/pandas_bench.py; } 2>&1 | tail -1 )
225+
ms=$( { /usr/bin/time -f "%e" pyhl run /tmp/pandas_bench.py > /dev/null; } 2>&1 )
216226
ms_int=$(echo "$ms * 1000" | bc | cut -d. -f1)
217227
times+=($ms_int)
218228
echo " run $i: ${ms_int}ms"

0 commit comments

Comments
 (0)