Repository navigation
55 lines (53 loc) · 1.74 KB
/
Copy pathtest.yml
File metadata and controls
55 lines (53 loc) · 1.74 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
# .github/workflows/test.yml
# Primary CI workflow that runs on every push and PR
# - Builds the package
# - Runs all tests
# - Runs pre-commit hooks for code quality
# - Full matrix testing on pull requests and workflow_dispatch
# - Minimal testing (ubuntu-latest + Python 3.13) on push
name: Test
on: [push, pull_request, workflow_dispatch]
jobs:
test:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# Testing strategy:
# - Push events: Limited testing (ubuntu-latest + Python 3.13 only) for quick feedback
# - Pull requests and manual triggers: Full matrix testing across all platforms and Python versions
matrix:
os: >-
${{
github.event_name == 'push'
&& fromJSON('["ubuntu-latest"]')
|| fromJSON('["ubuntu-latest", "macos-latest", "windows-latest"]')
}}
python-version: >-
${{
github.event_name == 'push'
&& fromJSON('["3.13"]')
|| fromJSON('["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]')
}}
fail-fast: false
defaults:
run:
shell: bash -l {0}
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install package with dev dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Run tests
run: pytest
- name: Run pre-commit hooks
run: pre-commit run --all-files