-
Notifications
You must be signed in to change notification settings - Fork 20
115 lines (94 loc) · 3.06 KB
/
main.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
PYTHON_VERSION: '3.13'
# renovate: datasource=pypi depName=uv
UV_VERSION: '0.5.5'
jobs:
quality:
runs-on: ubuntu-24.04
steps:
- name: Check out
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: ${{ env.UV_VERSION }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Python dependencies
run: uv sync --frozen
- name: Setup Rust toolchain
run: rustup component add clippy rustfmt
- name: Run pre-commit
run: uvx pre-commit@${{ env.PRE_COMMIT_VERSION }} run -a --show-diff-on-failure
env:
# renovate: datasource=pypi depName=pre-commit
PRE_COMMIT_VERSION: '4.0.1'
- name: Inspect dependencies with deptry
run: uv run deptry python
tests:
strategy:
matrix:
os:
- name: linux
image: ubuntu-24.04
- name: macos
image: macos-15
- name: windows
image: windows-2022
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy3.10']
fail-fast: false
runs-on: ${{ matrix.os.image }}
name: ${{ matrix.os.name }} (${{ matrix.python-version }})
steps:
- name: Check out
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: ${{ env.UV_VERSION }}
enable-cache: 'true'
cache-suffix: ${{ matrix.python-version }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: uv sync --frozen --group test --group typing
- name: Check typing
run: uv run mypy
if: ${{ matrix.os.name == 'linux' }}
- name: Run unit tests
run: uv run pytest tests/unit --cov --cov-config=pyproject.toml --cov-report=xml
- name: Run functional tests
run: uv run pytest tests/functional -n auto --dist loadgroup
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: ${{ matrix.os.name == 'linux' && matrix.python-version == env.PYTHON_VERSION }}
check-docs:
runs-on: ubuntu-24.04
steps:
- name: Check out
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: ${{ env.UV_VERSION }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Check if documentation can be built
run: uv run --only-group docs mkdocs build --strict