|
| 1 | +# .github/workflows/ci.yml |
1 | 2 | name: CI |
2 | | - |
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | pull_request: |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - tests: |
| 8 | + tox: |
9 | 9 | runs-on: ubuntu-latest |
10 | 10 | strategy: |
11 | 11 | fail-fast: false |
12 | 12 | matrix: |
13 | | - python-version: ["3.6", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
| 13 | + python: ["3.6", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
| 14 | + include: |
| 15 | + # Older CPythons live on Debian Buster images |
| 16 | + - python: "3.6" |
| 17 | + image: "python:3.6-buster" |
| 18 | + # Current releases use Debian Bookworm images |
| 19 | + - python: "3.9" |
| 20 | + image: "python:3.9-bookworm" |
| 21 | + - python: "3.10" |
| 22 | + image: "python:3.10-bookworm" |
| 23 | + - python: "3.11" |
| 24 | + image: "python:3.11-bookworm" |
| 25 | + - python: "3.12" |
| 26 | + image: "python:3.12-bookworm" |
| 27 | + - python: "3.13" |
| 28 | + image: "python:3.13-bookworm" |
| 29 | + # If 3.14 is still pre-release for you, switch to 3.14-rc-bookworm. |
| 30 | + - python: "3.14" |
| 31 | + image: "python:3.14-bookworm" |
| 32 | + |
| 33 | + # Run each matrix entry *inside* the chosen Python image |
| 34 | + container: |
| 35 | + image: ${{ matrix.image }} |
| 36 | + |
14 | 37 | steps: |
15 | 38 | - uses: actions/checkout@v4 |
16 | 39 |
|
17 | | - - name: Set up Python ${{ matrix.python-version }} |
18 | | - uses: actions/setup-python@v5 |
| 40 | + # Cache pip inside the container filesystem |
| 41 | + - name: Set up pip cache |
| 42 | + uses: actions/cache@v4 |
19 | 43 | with: |
20 | | - python-version: ${{ matrix.python-version }} |
21 | | - cache: "pip" |
| 44 | + path: | |
| 45 | + ~/.cache/pip |
| 46 | + key: ${{ runner.os }}-pip-${{ matrix.python }}-${{ hashFiles('**/pyproject.toml', '**/requirements*.txt', 'tox.ini', 'setup.cfg', 'setup.py') }} |
| 47 | + restore-keys: | |
| 48 | + ${{ runner.os }}-pip-${{ matrix.python }}- |
| 49 | +
|
| 50 | + - name: Show Python |
| 51 | + run: python -V && which python && pip -V |
22 | 52 |
|
23 | | - - name: Install tox (and plugin to map py versions) |
| 53 | + - name: Upgrade pip & install tox |
24 | 54 | run: | |
25 | | - python -m pip install --upgrade pip |
26 | | - pip install tox tox-gh-actions |
| 55 | + python -m pip install --upgrade pip |
| 56 | + pip install tox |
27 | 57 |
|
28 | | - - name: Run tox |
29 | | - run: tox |
| 58 | + - name: Run tox for current interpreter |
| 59 | + run: tox -e py |
30 | 60 |
|
0 commit comments