-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (56 loc) · 1.76 KB
/
Copy pathcheck.yaml
File metadata and controls
66 lines (56 loc) · 1.76 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: test
on:
push:
branches: [dev]
paths:
- "**.py"
- ".github/workflows/check.yaml"
- "pyproject.toml"
pull_request:
branches: [dev, main]
paths:
- "**.py"
- ".github/workflows/check.yaml"
- "pyproject.toml"
jobs:
build:
runs-on: ubuntu-latest
env:
UV_CACHE_DIR: /tmp/.uv-cache
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
name: check ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Set special env for 3.14t
if: matrix.python-version == '3.14t'
run: echo "PYTHON_GIL=0" >> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
run: |
uv python install ${{ matrix.python-version }}
uv python pin ${{ matrix.python-version }}
uv lock
PY=$(uv run python -VV | shasum -a 256 | cut -d' ' -f1)
echo PY: $PY
echo "PY=$PY" >> "$GITHUB_OUTPUT"
- name: Restore uv cache
uses: actions/cache@v4
id: uv-cache
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ steps.setup-python.outputs.PY }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ steps.setup-python.outputs.PY }}-${{ hashFiles('uv.lock') }}
uv-${{ steps.setup-python.outputs.PY }}
- name: Install dependencies
if: steps.uv-cache.outputs.cache-hit != 'true'
run: uv sync
- name: Test with pytest
timeout-minutes: 10
run: uv run pytest --no-cov --color=yes -vv
- name: Minimize uv cache
run: uv cache prune --ci