charasheet/.github/workflows/test.yaml

36 lines
950 B
YAML
Raw Normal View History

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
uses: actions/checkout@v4
2022-10-31 09:02:54 +01:00
- name: Set up Python
uses: actions/setup-python@v5
2022-10-31 09:02:54 +01:00
with:
2023-10-24 11:45:17 +02:00
python-version: '3.12'
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
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/