-
Notifications
You must be signed in to change notification settings - Fork 5
98 lines (80 loc) · 2.38 KB
/
Copy pathtests.yml
File metadata and controls
98 lines (80 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: Tests (py${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.14"]
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install project
run: uv sync --group dev
- name: Run pytest
run: uv run --no-sync pytest
smoke:
name: Demo smoke run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install project
run: uv sync
- name: Benchmark registry loads
run: uv run --no-sync benchkit --list
# Exercises the engine, the offline client, and the report writers end to
# end without needing an inference server.
- name: Headless demo run
run: |
uv run --no-sync benchkit --demo --headless \
--models demo-nano:0.5b --benchmarks sanity:3
- name: Check report artifacts
run: |
run_dir=$(ls -d results/*/ | tail -1)
echo "Inspecting $run_dir"
for name in results.json results.csv results.md results.html; do
test -s "$run_dir$name" || { echo "missing or empty: $name"; exit 1; }
done
python -c "import json,sys; json.load(open(sys.argv[1]))" "$run_dir/results.json"
- name: Upload report artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: demo-results
path: results/
retention-days: 7
if-no-files-found: warn
build:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Build sdist and wheel
run: uv build
- name: Check that the wheel imports
run: |
uv run --no-project --isolated --with dist/*.whl \
python -c "import benchkit, benchkit.cli; print(benchkit.__name__)"