fix formatting #219
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- "master" | |
tags: | |
- "*" | |
pull_request: | |
branches: | |
- "master" | |
workflow_dispatch: | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Set up Python | |
run: uv python install | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
- name: Ruff Format Check | |
run: uv run ruff format --check | |
- name: Ruff Check | |
run: uv run ruff check --diff | |
- name: Check twine | |
shell: bash | |
run: | | |
uv build | |
uv run twine check dist/*.tar.gz | |
test: | |
name: Test | |
needs: check | |
strategy: | |
matrix: | |
os: [ubuntu, macos, windows] | |
fail-fast: true | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Set up Python | |
run: uv python install | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
- name: Test | |
run: uv run pytest | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
needs: test | |
# Run only on pushing a tag starting with v | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Set up Python | |
run: uv python install | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
- name: Build | |
run: uv build | |
- name: Publish to PyPI | |
run: | | |
uv publish --token $PYPI_TOKEN | |
# I suppose this is kinda useful to have, but, really, its just so that the mkdocs scraper | |
# can determine the latest version number in its github section. | |
- name: Github release | |
shell: bash | |
run: | | |
gh release create --generate-notes ${{ github.ref }} dist/* | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |