Skip to content

[pre-commit.ci] pre-commit autoupdate #71

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #71

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch: # Allows manual triggering
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv sync --dev
- name: Run tests with coverage
run: |
uv run pytest test/ \
--cov=src/malphite \
--cov-branch \
--cov-report=xml \
--junitxml=junit.xml \
-o junit_family=legacy
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.os }}-py${{ matrix.python-version }}
path: |
pytest-results.xml
htmlcov/
coverage.xml
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}