9162ba7ae0
ruff check, ruff format check, ty check, and pytest now run as four independent jobs instead of one sequential lint job gating test — faster wall-clock CI since none of these checks depend on each other. build still waits on all four before bumping/publishing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
79 lines
2.1 KiB
YAML
79 lines
2.1 KiB
YAML
name: CI
|
|
|
|
"on":
|
|
push:
|
|
branches: ["**"]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
ruff-check:
|
|
name: Lint (ruff check)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v5
|
|
with:
|
|
enable-cache: true
|
|
- run: uv sync --extra cpu --extra dev
|
|
- run: uv run ruff check .
|
|
|
|
ruff-format:
|
|
name: Format (ruff format)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v5
|
|
with:
|
|
enable-cache: true
|
|
- run: uv sync --extra cpu --extra dev
|
|
- run: uv run ruff format --check .
|
|
|
|
type-check:
|
|
name: Type check (ty)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v5
|
|
with:
|
|
enable-cache: true
|
|
- run: uv sync --extra cpu --extra dev
|
|
- run: uv run ty check .
|
|
|
|
test:
|
|
name: Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v5
|
|
with:
|
|
enable-cache: true
|
|
- run: uv sync --extra cpu --extra dev
|
|
- run: uv run pytest
|
|
|
|
build:
|
|
name: Bump version, build & publish wheel
|
|
needs: [ruff-check, ruff-format, type-check, test]
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.CI_TOKEN }}
|
|
- uses: astral-sh/setup-uv@v5
|
|
- name: Bump patch version
|
|
run: |
|
|
git config user.name "gitea-actions"
|
|
git config user.email "actions@git.larsbogner.de"
|
|
uv version --bump patch --no-sync
|
|
NEW_VERSION=$(uv version --short)
|
|
git add pyproject.toml uv.lock
|
|
git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]"
|
|
git push
|
|
- run: uv build
|
|
- name: Publish to Gitea package registry
|
|
env:
|
|
TWINE_USERNAME: ${{ secrets.PACKAGE_USERNAME }}
|
|
TWINE_PASSWORD: ${{ secrets.CI_TOKEN }}
|
|
run: uvx twine upload --repository-url https://git.larsbogner.de/api/packages/lars/pypi dist/*
|