Skip to content

ci: add CI, coverage, and CodeQL workflows #3

ci: add CI, coverage, and CodeQL workflows

ci: add CI, coverage, and CodeQL workflows #3

Workflow file for this run

name: Coverage
on:
push:
branches: [main]
tags-ignore: ["v*.*.*"]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
coverage:
name: Coverage (Ubuntu, py3.12)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Set up Python
run: uv python install 3.12
- name: Sync dependencies
run: uv sync --extra dev --extra ollama
- name: Run tests with coverage
run: |
uv run pytest --cov=modeldock --cov-report=term-missing \
--cov-report=xml:coverage.xml --cov-report=html:htmlcov
- name: Upload coverage XML
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-xml
path: coverage.xml
if-no-files-found: ignore
- name: Upload HTML coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: htmlcov
path: htmlcov
if-no-files-found: ignore
- name: Upload to Codecov
if: always()
uses: codecov/codecov-action@v4
with:
files: coverage.xml
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}