2022-10-31 09:02:54 +01:00
|
|
|
name: Test
|
|
|
|
|
|
|
|
on:
|
2023-01-30 15:09:11 +01:00
|
|
|
workflow_dispatch:
|
2022-10-31 09:02:54 +01:00
|
|
|
workflow_call:
|
|
|
|
|
2023-01-18 15:12:12 +01:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-10-31 09:02:54 +01:00
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
name: Python tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-11 11:58:41 +00:00
|
|
|
uses: actions/checkout@v4
|
2025-01-05 11:18:04 +01:00
|
|
|
- name: Install uv
|
|
|
|
uses: astral-sh/setup-uv@v5
|
2022-10-31 09:02:54 +01:00
|
|
|
- name: Set up Python
|
2023-12-11 11:41:36 +00:00
|
|
|
uses: actions/setup-python@v5
|
2022-10-31 09:02:54 +01:00
|
|
|
with:
|
2025-01-05 11:18:04 +01:00
|
|
|
python-version-file: "pyproject.toml"
|
|
|
|
- name: Install the project
|
|
|
|
run: uv sync --all-extras --dev --frozen --no-install-project
|
2023-03-14 10:29:06 +01:00
|
|
|
- name: Setup pre-commit cache
|
2024-01-22 11:08:51 +00:00
|
|
|
uses: actions/cache@v4
|
2023-03-14 10:29:06 +01:00
|
|
|
with:
|
|
|
|
path: ~/.cache/pre-commit
|
|
|
|
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
2023-03-14 09:29:35 +01:00
|
|
|
- name: Check pre-commit
|
2025-01-05 11:18:04 +01:00
|
|
|
run: uv run pre-commit run --show-diff-on-failure --color=always --all-files
|
2023-03-14 10:50:53 +01:00
|
|
|
- name: Test
|
2025-01-05 11:18:04 +01:00
|
|
|
run: uv run pytest --cov=. --cov-branch --cov-report term-missing:skip-covered
|
2023-03-14 10:50:53 +01:00
|
|
|
working-directory: ./src/
|