ci: isolate uv caches by Python version #20
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: | |
| paths: | |
| - "cli/**" | |
| - "js/**" | |
| - ".github/workflows/ci.yml" | |
| - ".github/workflows/release.yml" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "cli/**" | |
| - "js/**" | |
| - ".github/workflows/ci.yml" | |
| - ".github/workflows/release.yml" | |
| jobs: | |
| test-cli: | |
| name: Test CLI package (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.12", "3.13"] | |
| env: | |
| UV_PYTHON: ${{ matrix.python-version }} | |
| defaults: | |
| run: | |
| working-directory: cli | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: uv.lock | |
| cache-suffix: python-${{ matrix.python-version }} | |
| working-directory: cli | |
| - name: Install Python | |
| run: uv python install "${{ matrix.python-version }}" | |
| - name: Sync dependencies | |
| run: uv sync --locked --dev | |
| - name: Verify Python runtime | |
| run: uv run python -c "import os, sys; expected = tuple(map(int, os.environ['UV_PYTHON'].split('.'))); assert sys.version_info[:2] == expected, sys.version" | |
| - name: Type check | |
| run: uv run ty check | |
| - name: Run tests | |
| run: uv run pytest | |
| - name: Lint | |
| run: uv run ruff check | |
| - name: Check formatting | |
| run: uv run ruff format --check | |
| - name: Smoke test CLI help | |
| run: | | |
| uv run glasskit --help | |
| uv run glasskit eval --help | |
| - name: Build package | |
| run: uv build --no-sources --clear | |
| test-js: | |
| name: Test JS create package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| working-directory: js | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| cache-dependency-path: js/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Test | |
| run: npm test | |
| - name: Check package contents | |
| run: npm pack --dry-run |