-
-
Notifications
You must be signed in to change notification settings - Fork 8
80 lines (68 loc) · 2.28 KB
/
Copy pathtest.yml
File metadata and controls
80 lines (68 loc) · 2.28 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Tests
on:
pull_request:
workflow_dispatch:
push:
branches:
- main
paths:
- sieves/**
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Maximize build space
shell: bash
run: |
sudo rm -rf /usr/share/dotnet \
/usr/local/lib/android \
/opt/ghc \
/opt/hostedtoolcache/CodeQL
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install tesseract-ocr
- name: Install Python dependencies
run: |
uv venv .venv --python 3.12 --clear
uv build
source .venv/bin/activate
uv pip install ./dist/sieves-*.whl
# Optional dependencies need to be installed in separate command.
# Note: due to `setfit` not supporting `transformers` v5 yet, installing the `distill` extra runs with v4 of
# `transformers`. As we're installing all packages for tests, we're running the test suite with `transformers`
# v4. This is an ok tradeoff for now, given the minimal integration surface of `transformers` within `sieves`.
uv pip install 'sieves[ingestion,distill,optimization,test]'
- name: Build docs
run: |
source .venv/bin/activate
mkdocs build
- name: Stage tests out-of-tree
run: |
mkdir -p "$RUNNER_TEMP/sieves-tests"
rsync -a --delete sieves/tests/ "$RUNNER_TEMP/sieves-tests/"
- name: Run tests
working-directory: ${{ runner.temp }}/sieves-tests
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
run: |
source $GITHUB_WORKSPACE/.venv/bin/activate
pytest -x --cov=sieves --cov-report=xml:$GITHUB_WORKSPACE/coverage.xml -m "not slow" -c "$GITHUB_WORKSPACE/pyproject.toml"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml