Repository navigation
ci(governance): adopt the shared PR governance action #135
Workflow file for this run
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| actionlint: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Actionlint | |
| uses: docker://rhysd/actionlint:1.7.12 | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check whitespace | |
| run: | | |
| set -euo pipefail | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| git fetch --no-tags --depth=1 origin "${{ github.base_ref }}" | |
| git diff --check "origin/${{ github.base_ref }}...HEAD" | |
| else | |
| # -M matters. `git diff-tree` is plumbing and does no rename | |
| # detection unless asked, so a renamed file is compared as if it | |
| # were wholly new and every trailing space already in it is | |
| # reported against this commit. `git diff` above does detect | |
| # renames, which is why only this branch has the problem. | |
| git diff-tree --check --no-commit-id --root -r -M HEAD | |
| fi | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Install package and test dependencies | |
| run: | | |
| set -euo pipefail | |
| python -m pip install --upgrade pip | |
| python -m pip install -e . pytest 'ruff==0.15.22' build | |
| - name: Verify dependencies | |
| run: python -m pip check | |
| - name: Ruff | |
| run: ruff check . | |
| - name: Run tests | |
| run: python -m pytest tests -q | |
| - name: Build package | |
| run: python -m build |