type checking in CI uses stub files correctly #88
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
| # ci.yml | |
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths: &target_paths | |
| - "src/**" | |
| - "tests/**" | |
| - "pyproject.toml" | |
| - "uv.lock" | |
| pull_request: | |
| branches: [main, develop] | |
| paths: *target_paths | |
| jobs: | |
| checks: | |
| name: ${{ matrix.task.name }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| task: | |
| - name: Test | |
| command: "task test" | |
| - name: Lint | |
| command: "task lint" | |
| - name: Typecheck | |
| command: "task typecheck" | |
| env: | |
| UV_CACHE_DIR: /tmp/.uv-cache | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: ".python-version" | |
| - name: Install dependencies | |
| run: | | |
| uv sync --locked --all-extras --dev | |
| uv pip install . | |
| - name: Restore uv cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: /tmp/.uv-cache | |
| key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
| restore-keys: | | |
| uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
| uv-${{ runner.os }} | |
| - name: Run Task | |
| run: | | |
| export PYTHONPATH=$(pwd) | |
| uv run ${{ matrix.task.command }} | |
| - name: Minimize uv cache | |
| run: uv cache prune --ci |