Repository navigation
70 lines (58 loc) · 1.46 KB
/
Copy pathci.yml
File metadata and controls
70 lines (58 loc) · 1.46 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
68
69
70
# ci.yml
name: CI
on:
push:
branches: [main]
paths: &target_paths
- "src/**"
- "tests/**"
- "pyproject.toml"
- "uv.lock"
pull_request:
branches: [main, develop]
paths: *target_paths
jobs:
checks:
name: ${{ matrix.task.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
task:
- name: Test
command: "task test"
- name: Lint
command: "task lint"
- name: Typecheck
command: "task typecheck"
env:
UV_CACHE_DIR: /tmp/.uv-cache
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- name: Install dependencies
run: |
uv sync --locked --all-extras --dev
uv pip install .
- name: Restore uv cache
uses: actions/cache@v5
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 Task
run: |
export PYTHONPATH=$(pwd)
uv run ${{ matrix.task.command }}
- name: Minimize uv cache
run: uv cache prune --ci