-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (104 loc) · 3.4 KB
/
Copy pathci.yml
File metadata and controls
111 lines (104 loc) · 3.4 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
name: CI
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.2.0
with:
python-version: "3.12"
- run: uv sync --extra dev
- run: uv run ruff check src/ tests/
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11", "3.12", "3.13"]
include:
- os: windows-latest
python-version: "3.12"
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.2.0
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --extra dev
- name: Run tests (ubuntu, with coverage gate)
if: matrix.os == 'ubuntu-latest'
run: uv run pytest --cov=src/wealthbox_tools --cov-report=term --cov-fail-under=91
- name: Run tests (windows, no coverage gate)
if: matrix.os == 'windows-latest'
run: uv run pytest
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.2.0
with:
python-version: "3.12"
- run: uv sync --extra dev
- run: uv run mypy src/
smoke:
# Install the built wheel in isolation WITHOUT dev dependencies and run the
# entrypoint, so a missing runtime dependency (e.g. a module-level import of
# a package typer no longer pulls in) is caught before publish. The normal
# test job always has dev deps present and cannot catch this.
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.2.0
with:
python-version: "3.12"
- name: Build and smoke-test clean install
shell: bash
run: |
uv build
uv run --isolated --no-project --with "$(ls dist/*.whl)" wbox --version
uv run --isolated --no-project --with "$(ls dist/*.whl)" wbox notes --help
skill-ref-drift:
needs: [lint, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.2.0
with:
python-version: "3.12"
- run: uv sync --extra dev
- run: uv run wbox internals regen-skill-refs
- run: git diff --exit-code -- src/wealthbox_tools/skills/wealthbox-crm/references/
publish:
needs: [lint, test, typecheck, smoke, skill-ref-drift]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
id-token: write
environment: pypi
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.2.0
with:
python-version: "3.12"
- name: Check changelog matches version
run: |
python - <<'PY'
import re, pathlib, sys
ver = re.search(r'^version\s*=\s*"([^"]+)"', pathlib.Path("pyproject.toml").read_text(encoding="utf-8"), re.M).group(1)
m = re.search(r'^##\s*\[([0-9]+\.[0-9]+\.[0-9]+)\]', pathlib.Path("CHANGELOG.md").read_text(encoding="utf-8"), re.M)
top = m.group(1) if m else None
print(f"pyproject={ver} changelog={top}")
sys.exit(0 if top == ver else 1)
PY
- run: uv build
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true