Fix Ruff format race condition (#11) #35
This file contains hidden or 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: Test Polymath Code Standard | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| name: standardize thyself | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - run: python -m pip install pre-commit | |
| shell: bash | |
| - run: python -m pip freeze --local | |
| shell: bash | |
| - run: pre-commit run --show-diff-on-failure --color=always | |
| shell: bash | |
| pytest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| - run: uv sync | |
| - run: uv run pytest | |
| tag-release: | |
| runs-on: ubuntu-latest | |
| needs: [pre-commit, pytest] | |
| if: github.event_name == 'push' | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Tag version from pyproject.toml | |
| run: |- | |
| VERSION=$(grep '^version' pyproject.toml | sed 's/version = "\(.*\)"/\1/') | |
| TAG="v$VERSION" | |
| git config user.name 'github-actions[bot]' | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| if git tag "$TAG"; then | |
| git push origin "$TAG" | |
| echo "Tagged $TAG" | |
| else | |
| echo "Tag $TAG already exists, skipping" | |
| fi |