Skip to content

Commit b81c299

Browse files
committed
chore: migrate CI to uv; drop gitleaks-action; test on PR only
Switch all three workflows from pip+setup-python to uv+setup-uv. Remove secrets-scan job (gitleaks runs via pre-commit in lint job; gitleaks-action@v2 requires a paid org license). Test job now runs on pull_request only with fail-fast: false. docs.yml adds workflow_dispatch and src/**/*.py path trigger.
1 parent 5f947c6 commit b81c299

3 files changed

Lines changed: 33 additions & 45 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,52 +19,44 @@ jobs:
1919
- uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0
22-
token: ${{ secrets.GITHUB_TOKEN }}
23-
- uses: actions/setup-python@v5
22+
23+
- uses: astral-sh/setup-uv@v5
2424
with:
2525
python-version: "3.12"
26+
2627
- name: Install dependencies
27-
run: pip install .[dev]
28-
- name: Run pre-commit
29-
run: pre-commit run --all-files --show-diff-on-failure
28+
run: uv sync --extra dev
29+
30+
- name: Run pre-commit (ruff + mypy + commitizen + gitleaks)
31+
run: uv run pre-commit run --all-files --show-diff-on-failure
3032

3133
test:
32-
name: Test
34+
name: Test (Python ${{ matrix.python-version }})
3335
runs-on: ubuntu-latest
34-
if: "!startsWith(github.event.head_commit.message, 'bump:')"
36+
if: github.event_name == 'pull_request'
3537
strategy:
38+
fail-fast: false
3639
matrix:
37-
python-version: ["3.10", "3.11", "3.12"]
40+
python-version: ["3.10", "3.12", "3.13"]
3841
steps:
3942
- uses: actions/checkout@v4
4043
with:
4144
fetch-depth: 0
42-
token: ${{ secrets.GITHUB_TOKEN }}
43-
- uses: actions/setup-python@v5
45+
46+
- uses: astral-sh/setup-uv@v5
4447
with:
4548
python-version: ${{ matrix.python-version }}
46-
- name: Install
47-
run: pip install .[dev]
48-
- name: Run tests
49-
run: pytest --tb=short
5049

51-
secrets-scan:
52-
name: Secrets scan
53-
runs-on: ubuntu-latest
54-
if: "!startsWith(github.event.head_commit.message, 'bump:')"
55-
permissions:
56-
contents: read
57-
pull-requests: write
58-
steps:
59-
- uses: actions/checkout@v4
60-
- uses: gitleaks/gitleaks-action@v2
61-
env:
62-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
- name: Install dependencies
51+
run: uv sync --extra dev
52+
53+
- name: Run tests
54+
run: uv run pytest --tb=short
6355

6456
ci:
6557
name: CI
6658
runs-on: ubuntu-latest
67-
needs: [lint, test, secrets-scan]
59+
needs: [lint, test]
6860
if: always()
6961
steps:
7062
- name: Check required jobs
@@ -75,7 +67,4 @@ jobs:
7567
if [[ "${{ needs.test.result }}" != "success" && "${{ needs.test.result }}" != "skipped" ]]; then
7668
echo "test failed" && exit 1
7769
fi
78-
if [[ "${{ needs.secrets-scan.result }}" != "success" && "${{ needs.secrets-scan.result }}" != "skipped" ]]; then
79-
echo "secrets-scan failed" && exit 1
80-
fi
8170
echo "All required checks passed."

.github/workflows/docs.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
paths:
77
- "docs/**"
88
- "mkdocs.yml"
9+
- "src/**/*.py"
910
- ".github/workflows/docs.yml"
1011
workflow_dispatch:
1112

@@ -14,17 +15,19 @@ permissions:
1415

1516
jobs:
1617
deploy:
17-
name: Deploy docs
18+
name: Deploy docs to GitHub Pages
1819
runs-on: ubuntu-latest
1920
steps:
2021
- uses: actions/checkout@v4
2122
with:
2223
fetch-depth: 0
23-
token: ${{ secrets.GITHUB_TOKEN }}
24-
- uses: actions/setup-python@v5
24+
25+
- uses: astral-sh/setup-uv@v5
2526
with:
2627
python-version: "3.12"
27-
- name: Install docs dependencies
28-
run: pip install mkdocs-material
28+
29+
- name: Install dependencies
30+
run: uv sync --extra docs
31+
2932
- name: Deploy
30-
run: mkdocs gh-deploy --force
33+
run: uv run mkdocs gh-deploy --force

.github/workflows/release.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,20 @@ jobs:
1818
- uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
21-
token: ${{ secrets.GITHUB_TOKEN }}
2221

2322
- name: Configure git identity
2423
run: |
2524
git config user.name "github-actions[bot]"
2625
git config user.email "github-actions[bot]@users.noreply.github.com"
2726
28-
- uses: actions/setup-python@v5
27+
- uses: astral-sh/setup-uv@v5
2928
with:
3029
python-version: "3.12"
3130

32-
- name: Install tools
33-
run: pip install commitizen hatchling hatch-vcs
34-
3531
- name: Bump version
3632
id: bump
3733
run: |
38-
cz bump --yes || EXIT=$?
34+
uvx --from commitizen cz bump --yes || EXIT=$?
3935
if [ "${EXIT:-0}" -eq 21 ]; then
4036
echo "No bumpable commits since last tag — skipping."
4137
echo "skipped=true" >> "$GITHUB_OUTPUT"
@@ -49,16 +45,16 @@ jobs:
4945
5046
- name: Build
5147
if: steps.bump.outputs.skipped != 'true'
52-
run: python -m hatchling build
48+
run: uv build
5349

5450
- name: Create GitHub release
5551
if: steps.bump.outputs.skipped != 'true'
5652
uses: softprops/action-gh-release@v2
5753
with:
5854
tag_name: "v${{ steps.bump.outputs.version }}"
5955
files: dist/*
60-
generate_release_notes: true
56+
generate_release_notes: false
6157

6258
- name: Publish to PyPI
6359
if: steps.bump.outputs.skipped != 'true'
64-
uses: pypa/gh-action-pypi-publish@release/v1
60+
run: uv publish --trusted-publishing automatic

0 commit comments

Comments
 (0)