add precommit and start fixing types #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: Linting and Type Checking | |
| on: [push, pull_request] | |
| env: | |
| PYTHON_VERSION: "3.10" | |
| UV_PROJECT_ENVIRONMENT: .venv | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check-ai: | |
| name: Check thirdweb-ai | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./python/thirdweb-ai | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@22695119d769bdb6f7032ad67b9bca0ef8c4a174 # v5 | |
| - name: Install Python | |
| uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Install the project | |
| run: uv sync --all-extras --dev | |
| - name: Configure path | |
| run: echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
| - name: Run Ruff linter | |
| run: uv run ruff check --output-format=github . | |
| - name: Run Ruff formatter | |
| run: uv run ruff format --check . | |
| - name: Run Pyright check | |
| uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2 | |
| with: | |
| version: PATH | |
| working-directory: ./python/thirdweb-ai | |
| check-mcp: | |
| name: Check thirdweb-mcp | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./python/thirdweb-mcp | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@22695119d769bdb6f7032ad67b9bca0ef8c4a174 # v5 | |
| - name: Install Python | |
| uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Install the project | |
| run: uv sync --all-extras --dev | |
| - name: Configure path | |
| run: echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
| - name: Run Ruff linter | |
| run: uv run ruff check --output-format=github . | |
| - name: Run Ruff formatter | |
| run: uv run ruff format --check . | |
| - name: Run Pyright check | |
| uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2 | |
| with: | |
| version: PATH | |
| working-directory: ./python/thirdweb-mcp |