ci: script #1
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: | |
| push: | |
| branches: ["*"] | |
| pull_request: | |
| branches: ["*"] | |
| workflow_dispatch: | |
| jobs: | |
| types: | |
| name: "Typecheck" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install Hatch | |
| run: pipx install hatch | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/hatch | |
| key: ${{ runner.os }}-hatch | |
| restore-keys: ${{ runner.os }}-hatch | |
| - name: Install dependencies | |
| run: | | |
| hatch env create dev | |
| - name: Run pyright | |
| run: | | |
| hatch run dev:pyright | |
| - name: Ensure Hatch environment is in PATH | |
| run: echo "$HOME/.cache/hatch/venv/bin" >> $GITHUB_PATH | |
| style: | |
| name: "Style check" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install Hatch | |
| run: pipx install hatch | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/hatch | |
| key: ${{ runner.os }}-hatch | |
| restore-keys: ${{ runner.os }}-hatch | |
| - name: Install dependencies | |
| run: hatch env create dev | |
| - name: Run ruff | |
| run: | | |
| hatch run dev:ruff check --output-format=github $(git ls-files '*.py') | |
| hatch run dev:ruff format --diff $(git ls-files '*.py') | |
| - name: Run spell-check | |
| run: | | |
| hatch run dev:codespell $(git ls-files) |