-
Notifications
You must be signed in to change notification settings - Fork 8
70 lines (54 loc) · 1.44 KB
/
test.yaml
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
name: Test
env:
# Enable colored output for pytest
# https://github.com/pytest-dev/pytest/issues/7443
# https://github.com/actions/runner/issues/241
PY_COLORS: 1
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main
permissions:
contents: read
# Limit concurrency by workflow/branch combination
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
python-tests:
name: python-${{ matrix.python-version }}, ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- "3.12"
fail-fast: false
runs-on: ${{ matrix.os }}
timeout-minutes: 10
env:
UV_CACHE_DIR: ~/.uv-cache
steps:
- uses: actions/checkout@v4
- name: Set up uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Restore uv cache
uses: actions/cache@v4
with:
path: ~/.uv-cache
key: uv-${{ runner.os }}
- name: Install packages
run: |
uv sync --all-extras --dev
- name: Run tests
run: |
uv run -- pytest tests
- name: Minimize uv cache
run: uv cache prune --ci