Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 64 additions & 49 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
workflow_dispatch:

env:
DEFAULT_PYTHON: "3.12"
DEFAULT_PYTHON: "3.13"
PRE_COMMIT_CACHE: ~/.cache/pre-commit

concurrency:
Expand All @@ -22,25 +22,28 @@ jobs:
# This prevent upcoming jobs to do the same individually
prepare:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13"]
outputs:
python-version: ${{ steps.python.outputs.python-version }}
name: Prepare Python dependencies
python-version: ${{ matrix.python-version }}
name: Prepare Python ${{ matrix.python-version }} dependencies
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
python-version: ${{ matrix.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected]
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{
hashFiles('pyproject.toml') }}
key: >
${{ runner.os }}-venv-${{ matrix.python-version }}-
${{ hashFiles('pyproject.toml') }}
- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand All @@ -54,9 +57,9 @@ jobs:
with:
path: ${{ env.PRE_COMMIT_CACHE }}
lookup-only: true
key: |
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml')
}}
key: >
${{ runner.os }}-pre-commit-${{ matrix.python-version }}-
${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pre-commit-
- name: Install pre-commit dependencies
Expand All @@ -66,25 +69,28 @@ jobs:
pre-commit install-hooks

lint-ruff-format:
name: Check ruff-format
name: Check ruff-format Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
needs: prepare
strategy:
matrix:
python-version: ["3.12", "3.13"]
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
python-version: ${{ matrix.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected]
with:
path: venv
key: |
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version
}}-${{ hashFiles('pyproject.toml') }}
key: >
${{ runner.os }}-venv-${{ matrix.python-version }}-
${{ hashFiles('pyproject.toml') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand All @@ -95,9 +101,9 @@ jobs:
uses: actions/[email protected]
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: |
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml')
}}
key: >
${{ runner.os }}-pre-commit-${{ matrix.python-version }}-
${{ hashFiles('.pre-commit-config.yaml') }}
- name: Fail job if cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand All @@ -112,25 +118,28 @@ jobs:
RUFF_OUTPUT_FORMAT: github

lint-ruff:
name: Check ruff
name: Check ruff Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
needs: prepare
strategy:
matrix:
python-version: ["3.12", "3.13"]
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
python-version: ${{ matrix.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected]
with:
path: venv
key: |
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version
}}-${{ hashFiles('pyproject.toml') }}
key: >
${{ runner.os }}-venv-${{ matrix.python-version }}-
${{ hashFiles('pyproject.toml') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand All @@ -141,9 +150,9 @@ jobs:
uses: actions/[email protected]
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: |
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml')
}}
key: >
${{ runner.os }}-pre-commit-${{ matrix.python-version }}-
${{ hashFiles('.pre-commit-config.yaml') }}
- name: Fail job if cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand All @@ -158,25 +167,28 @@ jobs:
RUFF_OUTPUT_FORMAT: github

lint-other:
name: Check other linters
name: Check other linters Python ${{ matrix.python-version }}
runs-on: ubuntu-24.04
needs: prepare
strategy:
matrix:
python-version: ["3.12", "3.13"]
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
python-version: ${{ matrix.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected]
with:
path: venv
key: |
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version
}}-${{ hashFiles('pyproject.toml') }}
key: >
${{ runner.os }}-venv-${{ matrix.python-version }}-
${{ hashFiles('pyproject.toml') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand All @@ -187,9 +199,9 @@ jobs:
uses: actions/[email protected]
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: |
${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml')
}}
key: >
${{ runner.os }}-pre-commit-${{ matrix.python-version }}-
${{ hashFiles('.pre-commit-config.yaml') }}
- name: Fail job if cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -249,23 +261,26 @@ jobs:
pytest:
runs-on: ubuntu-latest
needs: prepare
name: Run tests Python ${{ needs.prepare.outputs.python-version }}
strategy:
matrix:
python-version: ["3.12", "3.13"]
name: Run tests Python ${{ matrix.python-version }}
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
python-version: ${{ matrix.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected]
with:
path: venv
key: |
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version
}}-${{ hashFiles('pyproject.toml') }}
key: >
${{ runner.os }}-venv-${{ matrix.python-version }}-
${{ hashFiles('pyproject.toml') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -304,26 +319,26 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/[email protected]
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected]
with:
path: venv
key: |
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version
}}-${{ hashFiles('pyproject.toml') }}
key: >
${{ runner.os }}-venv-${{ env.DEFAULT_PYTHON }}-
${{ hashFiles('pyproject.toml') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Download all coverage artifacts
uses: actions/download-artifact@v4.1.8
uses: actions/download-artifact@v5.0.0
- name: Combine coverage results
run: |
. venv/bin/activate
Expand Down