-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (52 loc) · 1.68 KB
/
Copy pathci.yml
File metadata and controls
56 lines (52 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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