| 1 |
name: Unit tests |
| 2 |
permissions: |
| 3 |
contents: read |
| 4 |
|
| 5 |
on: [push, pull_request] |
| 6 |
|
| 7 |
jobs: |
| 8 |
unit_tests: |
| 9 |
|
| 10 |
runs-on: ${{ matrix.os }} |
| 11 |
strategy: |
| 12 |
matrix: |
| 13 |
os: [ubuntu-latest, macos-latest, windows-latest] |
| 14 |
python-version: ["3.12", "3.13", "3.14"] |
| 15 |
|
| 16 |
steps: |
| 17 |
- uses: actions/checkout@v6 |
| 18 |
- name: Set up Python ${{ matrix.python-version }} |
| 19 |
uses: actions/setup-python@v6 |
| 20 |
with: |
| 21 |
python-version: ${{ matrix.python-version }} |
| 22 |
- name: Install dependencies |
| 23 |
run: | |
| 24 |
python -m pip install --upgrade pip |
| 25 |
pip install -r requirements.txt |
| 26 |
pip install -r requirements_test.txt |
| 27 |
- name: Test with pytest |
| 28 |
run: pytest -v --cov-config=pyproject.toml --cov=cookidoo_api --cov-report=xml |
| 29 |
- name: Upload coverage to Codecov |
| 30 |
uses: codecov/codecov-action@v6 |
| 31 |
with: |
| 32 |
fail_ci_if_error: true |
| 33 |
token: ${{ secrets.CODECOV_TOKEN }} |
| 34 |
verbose: true |