👷 Updated action to use uv

This commit is contained in:
Wouter de Bruijn
2026-02-02 18:48:00 +01:00
parent 49c6b4644c
commit 6b29a70aea
+18 -23
View File
@@ -1,32 +1,27 @@
---
name: Pytest code testing
name: Tests
on:
pull_request:
workflow_call:
jobs:
test_code:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-mock coverage pytest-cov
pip install -r requirements.txt
- name: Testing the code with PyTest
run: |
cp config.py.example config.py
pytest tests
- name: Run tests with coverage
run: |
cp config.py.example config.py
coverage run -m pytest tests
- name: Check coverage percentage
run: |
coverage report --fail-under=70
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --dev
- name: Copy example config
run: cp config.py.example config.py
- name: Run tests with coverage
run: uv run pytest tests --cov --cov-report=term --cov-fail-under=70