-
Notifications
You must be signed in to change notification settings - Fork 356
67 lines (59 loc) · 2.04 KB
/
Copy pathpython-test.yml
File metadata and controls
67 lines (59 loc) · 2.04 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
name: Python Automated Testing
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v6
- name: Install uv and set-up python
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
version: latest
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Cache Hugging Face models
uses: actions/cache@v5
with:
path: ~/.cache/huggingface/hub
key: ${{ runner.os }}-huggingface-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-huggingface-
- name: Run tests
run: |
uv run --all-extras --dev pytest -nlogical --dist=worksteal -vv --cov=chonkie --cov-branch --cov-report=xml --cov-report=term-missing --junitxml=junit.xml
env:
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
CHONKIE_API_KEY: ${{ secrets.CHONKIE_API_KEY }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
JINA_API_KEY: ${{ secrets.JINA_API_KEY }}
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: chonkie-inc/chonkie
# Only upload coverage from the latest Python version
fail_ci_if_error: false
verbose: true
override_commit: ${{ github.sha }}
flags: python-${{ matrix.python-version }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: python-${{ matrix.python-version }}
fail_ci_if_error: false
verbose: true