-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (55 loc) · 1.56 KB
/
Copy pathci.yml
File metadata and controls
66 lines (55 loc) · 1.56 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
name: build
permissions:
contents: read
on:
push:
branches: [ main ]
paths: [ "**/*.py", "pyproject.toml", "uv.lock", ".github/workflows/**"]
pull_request:
branches: [ main ]
paths: [ "**/*.py", "pyproject.toml", "uv.lock", ".github/workflows/**"]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up uv with Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
# Cache key will include uv.lock hash automatically
- name: Install dependencies
run: |
uv sync --locked --all-extras --all-groups
- name: Run tests
run: |
uv run pytest tests --maxfail=1 --disable-warnings --tb=short -v
# Prune cache to optimize storage
- name: Minimize uv cache
run: uv cache prune --ci
if: always()
# Check if uv.lock is up to date
check-lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Check if uv.lock is up to date
run: |
uv sync --locked --all-extras --all-groups --dry-run