Skip to content

Commit 9456151

Browse files
committed
add pytest CI
1 parent 29f02b6 commit 9456151

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/pytest.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Python Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@22695119d769bdb6f7032ad67b9bca0ef8c4a174 # v5
21+
22+
- name: Install Python
23+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
24+
with:
25+
enable-cache: true
26+
cache-dependency-glob: "uv.lock" # Update cache if uv.lock changes
27+
28+
- name: Install the project
29+
run: uv sync --all-extras --dev --project python/thirdweb-ai/pyproject.toml
30+
31+
- name: Test with pytest
32+
run: |
33+
uv run pytest python/thirdweb-ai/tests/ --cov=thirdweb_ai --cov-report=xml
34+
35+
- name: Upload coverage to Codecov
36+
uses: codecov/codecov-action@v3
37+
with:
38+
file: ./coverage.xml
39+
fail_ci_if_error: true

0 commit comments

Comments
 (0)