-
Notifications
You must be signed in to change notification settings - Fork 41
136 lines (115 loc) · 4.14 KB
/
main.yml
File metadata and controls
136 lines (115 loc) · 4.14 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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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' }}
permissions: {}
jobs:
quality:
runs-on: ubuntu-24.04
steps:
- name: Check out
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: '0.11.8'
enable-cache: true
cache-dependency-glob: 'uv.lock'
- name: Install Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.14'
- name: Install Python dependencies
# We want to install all groups here to make sure that deptry has access to all dependencies for the inspection,
# even development ones.
run: uv sync --frozen
- name: Setup Rust toolchain
run: rustup component add clippy rustfmt
- uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2.0.3
with:
# We skip mypy hook because it runs in "tests" job.
extra-args: '--all-files --skip mypy'
- name: Inspect dependencies with deptry
run: uv run deptry python
tests:
strategy:
matrix:
os:
- name: linux
image: ubuntu-24.04
- name: macos
image: macos-26
- name: windows
image: windows-2025
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
- '3.14t'
- 'pypy3.11'
fail-fast: false
runs-on: ${{ matrix.os.image }}
name: ${{ matrix.os.name }} (${{ matrix.python-version }})
environment:
name: tests
deployment: false
steps:
- name: Check out
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: '0.11.8'
enable-cache: true
cache-dependency-glob: 'uv.lock'
cache-suffix: ${{ matrix.python-version }}
- name: Install Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: uv sync --frozen --no-default-groups --group test --group typing
- name: Check typing
run: uv run --no-default-groups mypy
if: ${{ matrix.os.name == 'linux' && !startsWith(matrix.python-version, 'pypy') }}
- name: Run unit tests
run: uv run --no-default-groups pytest tests/unit --cov --cov-config=pyproject.toml --cov-report=xml
- name: Run functional tests
run: uv run --no-default-groups pytest tests/functional -n auto --dist loadgroup
env:
PYTHONIOENCODING: 'utf-8'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: ${{ matrix.os.name == 'linux' && matrix.python-version == '3.14' }}
check-docs:
runs-on: ubuntu-24.04
steps:
- name: Check out
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: '0.11.8'
enable-cache: true
cache-dependency-glob: 'uv.lock'
- name: Install Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.14'
- name: Check if documentation can be built
run: uv run --only-group docs zensical build --strict