Repository navigation
54 lines (45 loc) · 1.52 KB
/
Copy pathpython-tests.yml
File metadata and controls
54 lines (45 loc) · 1.52 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
name: Python Tests
on:
workflow_dispatch:
push:
paths:
- 'python/**'
- 'testdata/**'
pull_request:
branches: [main]
paths:
- 'python/**'
- 'testdata/**'
# Least-privilege token: these jobs only check out and run tests, so
# contents: read is all actions/checkout needs. Declaring the block explicitly
# also avoids the private-fork checkout 404 that bites any workflow which later
# adds a write scope (e.g. issues: write) without re-listing contents.
permissions:
contents: read
jobs:
test:
name: Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: pip install -e "./python[dev]"
- name: Run unit tests
run: python -m pytest python/tests/ -v --tb=short -k "not cross_validation"
- name: Run cross-validation tests (if reference data exists)
run: |
if ls testdata/*.json 1>/dev/null 2>&1; then
python -m pytest python/tests/test_cross_validation.py -v --tb=short
else
echo "No reference JSON files found — skipping cross-validation."
fi
- name: Run example notebooks
run: python -m pytest --nbmake python/examples/ -v --tb=short