-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (69 loc) · 2.04 KB
/
ci.yml
File metadata and controls
81 lines (69 loc) · 2.04 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
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
name: Ruff lint
with:
version: "0.15.0"
args: check src/ tests/ selftests/ examples/
- uses: astral-sh/ruff-action@v3
name: Ruff format
with:
version: "0.15.0"
args: format --check src/ tests/ selftests/ examples/
selftest:
name: Selftests (${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }}
- name: Verify import
run: uv run python -c "import vip; print(vip.__version__)"
- name: Run selftests
run: uv run pytest selftests/ -v --junitxml=selftest-results.xml
- name: Collect VIP tests (dry run)
run: uv run pytest tests/ --collect-only --quiet
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: selftest-results-py${{ matrix.python-version }}
path: selftest-results.xml
verify-demo:
name: Verify showboat demo
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: uv sync
- name: Check for demo
id: check
run: |
if [ -f demo.md ]; then
echo "found=true" >> "$GITHUB_OUTPUT"
else
echo "found=false" >> "$GITHUB_OUTPUT"
echo "No demo.md found — skipping verification"
fi
- name: Verify demo
if: steps.check.outputs.found == 'true'
run: uvx showboat verify demo.md