Skip to content

Commit 16ea7c9

Browse files
committed
chore: add GitHub Actions workflow for testing across multiple Python versions
1 parent 9cdf9a6 commit 16ea7c9

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
env:
10+
# enable colored output
11+
PY_COLORS: 1
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
test:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
python-version: ["3.10", "3.11", "3.12"]
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Set up uv
28+
uses: astral-sh/setup-uv@v6
29+
with:
30+
version: "latest"
31+
enable-cache: true
32+
python-version: ${{ matrix.python-version }}
33+
cache-dependency-glob: |
34+
uv.lock
35+
pyproject.toml
36+
37+
- name: Install dependencies
38+
run: uv sync --locked
39+
40+
- name: Run all tests
41+
run: uv run pytest
42+
env:
43+
MODELSCOPE_API_TOKEN: ${{ secrets.MODELSCOPE_API_TOKEN }}
44+
45+
- name: Optimize uv cache for CI
46+
run: uv cache prune --ci

0 commit comments

Comments
 (0)