Skip to content

Commit 221df3a

Browse files
committed
ci: run unit/integration/security tests on push and PR
Add a Tests workflow (separate from publish.yml) that runs the offline pytest suite on push and pull_request across Python 3.9/3.11/3.13, with unit, integration, and security tests as separate steps. Live tests stay skipped (RUN_LIVE_TESTS unset), so no proot or network access is required.
1 parent 722ef50 commit 221df3a

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: tests-${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
name: Test suite (Python ${{ matrix.python-version }})
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
# Cover the floor and the latest of the supported range
22+
# (pyproject: requires-python = ">=3.9").
23+
python-version: ['3.9', '3.11', '3.13']
24+
25+
steps:
26+
- uses: actions/checkout@v6
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v6
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
cache: 'pip'
33+
cache-dependency-path: pyproject.toml
34+
35+
- name: Install package with test extra
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install -e '.[test]'
39+
40+
# The offline suite needs neither proot nor network access; the opt-in
41+
# live tests stay skipped because RUN_LIVE_TESTS is unset.
42+
- name: Unit tests
43+
run: python -m pytest tests/unit
44+
45+
- name: Integration tests
46+
run: python -m pytest tests/integration
47+
48+
- name: Security tests
49+
run: python -m pytest tests/security

0 commit comments

Comments
 (0)