-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (111 loc) · 3.3 KB
/
ci.yaml
File metadata and controls
136 lines (111 loc) · 3.3 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:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
env:
# Set uv version
UV_VERSION: "0.9.4"
jobs:
pre-commit:
name: Pre-commit hooks (lint/format/spell/type, all files)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install dependencies
run: uv sync --all-groups
# Run the same hooks as locally; include push stage so pre-push hooks run too
- name: Run pre-commit (all files, commit & push stages)
uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files --hook-stage push
test:
name: Tests ${{ matrix.os }} / py${{ matrix.python }}
needs: pre-commit
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14, windows-latest]
python: ["3.11", "3.12", "3.13", "3.14"]
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install uv and set python version
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
python-version: ${{ matrix.python }}
enable-cache: true
- name: Install dependencies
run: uv sync --all-groups
- name: Run tests (full suite)
run: uv run pytest --cov --cov-branch --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
docs:
name: Build docs (mkdocs)
needs: [pre-commit, test]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install dependencies
run: uv sync --group docs
- name: Build HTML (fail on warnings)
run: uv run mkdocs build --strict
- name: Upload built docs artifact
uses: actions/upload-artifact@v6
with:
name: docs-html
path: site
package:
name: Package smoke test
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install dependencies
run: uv sync --all-groups
- name: Build and install wheel
run: |
uv build
python -m venv pkgtest
source pkgtest/bin/activate
python -m pip install --upgrade pip
python -m pip install dist/*.whl
python -c "import package_name as m; print(getattr(m, '__version__', 'OK'))"