chore: update docs workflows to use 'uv' for dependency management (#33) #31
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: "Library Checks" | |
| on: | |
| push: | |
| paths: | |
| - "discord/**" | |
| - "requirements/**" | |
| - "*.toml" | |
| - "*.py" | |
| - ".*" | |
| branches: [master] | |
| pull_request: | |
| paths: | |
| - "discord/**" | |
| - "requirements/**" | |
| - "*.toml" | |
| - "*.py" | |
| - ".*" | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: write-all | |
| jobs: | |
| codespell: | |
| if: ${{ github.event_name != 'schedule' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout Repository" | |
| uses: actions/checkout@v4 | |
| - name: "Setup Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: "Install uv" | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Sync dependencies | |
| run: uv sync --no-python-downloads --group dev | |
| - name: "Run codespell" | |
| run: | |
| uv run codespell --ignore-words-list="groupt,nd,ot,ro,falsy,BU" \ | |
| --exclude-file=".github/workflows/codespell.yml" | |
| ruff: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout Repository" | |
| uses: actions/checkout@v4 | |
| - name: "Setup Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: "Install uv" | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Sync dependencies | |
| run: uv sync --no-python-downloads --group dev | |
| - name: "Run ruff linter check" | |
| run: uv run ruff check discord/ | |
| - name: "Run ruff formatter check" | |
| run: uv run ruff format --check discord/ | |
| mypy: | |
| if: ${{ github.event_name != 'schedule' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout Repository" | |
| uses: actions/checkout@v4 | |
| - name: "Setup Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: "Install uv" | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Sync dependencies | |
| run: uv sync --no-python-downloads --group dev | |
| - name: "Setup cache" | |
| id: cache-mypy | |
| uses: actions/cache@v4 | |
| with: | |
| path: .mypy_cache | |
| key: mypy | |
| - name: "Make mypy cache directory" | |
| id: cache-dir-mypy | |
| run: mkdir -p -v .mypy_cache | |
| - name: "Run mypy" | |
| run: uv run mypy --non-interactive discord/ |