-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (38 loc) · 1.01 KB
/
tests.yml
File metadata and controls
41 lines (38 loc) · 1.01 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
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
tests:
env:
UV_CACHE_DIR: /tmp/.uv-cache
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Run tests
run: uv run pytest
- name: Type check
run: uv run ty check
- name: Lint
run: uv run ruff check .
- name: Minimize uv cache
run: uv cache prune --ci