Skip to content

ci

ci #80

Workflow file for this run

name: ci
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "0 6 * * *"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.1.0
with:
enable-cache: true
- run: uv python install 3.12
- run: uv sync --extra dev --frozen
- run: uv run ruff check
- run: uv run ruff format --check
- run: uv run mypy
# Audit the resolved third-party deps via a frozen export. pip-audit
# can't resolve our local `privacy-filter` package on PyPI, so we exclude
# it via `--no-emit-project` and let --strict catch any unaudited
# third-party dep.
- run: uv export --frozen --no-emit-project --extra dev -o /tmp/requirements.txt
- run: uv run pip-audit --strict -r /tmp/requirements.txt
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.1.0
with:
enable-cache: true
- run: uv python install 3.12
- run: uv sync --extra dev --frozen
- run: uv run pytest -m "not slow" --cov=privacy_filter
test-slow:
if: github.event_name == 'schedule' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.1.0
with:
enable-cache: true
- run: uv python install 3.12
- run: uv sync --extra dev --extra hf --frozen
- name: Cache HuggingFace model
uses: actions/cache@v5
with:
path: ~/.cache/huggingface
key: hf-${{ hashFiles('src/privacy_filter/detection/huggingface.py') }}
- run: uv run pytest -m slow