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 13:58:41 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-10-31 09:02:54 +01:00
|
|
|
- name: Set up Python
|
2023-12-11 12:41:36 +01:00
|
|
|
uses: actions/setup-python@v5
|
2022-10-31 09:02:54 +01:00
|
|
|
with:
|
2024-11-30 10:00:06 +01:00
|
|
|
python-version: '3.13'
|
2022-12-10 01:00:10 +01:00
|
|
|
cache: pip
|
2022-10-31 09:02:54 +01:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2022-12-10 01:00:10 +01:00
|
|
|
pip install pip-tools
|
|
|
|
pip-sync requirements.txt requirements-dev.txt
|
2023-03-14 10:29:06 +01:00
|
|
|
- name: Setup pre-commit cache
|
2024-01-22 12:08:51 +01: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
|
2023-03-14 10:29:06 +01:00
|
|
|
run: pre-commit run --show-diff-on-failure --color=always --all-files
|
2023-03-14 10:50:53 +01:00
|
|
|
- name: Test
|
|
|
|
run: pytest --cov=. --cov-branch --cov-report term-missing:skip-covered
|
|
|
|
working-directory: ./src/
|