name: "Perform Static Analysis" on: pull_request: workflow_dispatch: # will cancel previous workflows triggered by the same event and for the same ref for PRs or same SHA otherwise concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }} cancel-in-progress: true jobs: static: name: Static Analysis runs-on: ubuntu-latest steps: - name: Check out Repo uses: actions/checkout@v7 - name: Install uv uses: astral-sh/setup-uv@v10.0.1 with: version: "0.12.8" - name: Set up Python uses: actions/setup-python@v7 id: setup-python with: python-version-file: ".python-version" - name: Install python dependencies run: uv sync --locked --group static --group test - name: Run analysis run: | uv run --no-sync ruff format . --diff uv run --no-sync ruff check . uv run --no-sync mypy --no-incremental uv run --no-sync lint-imports # Informational: the deterministic guards are the import-linter contracts # above and tests/unit_tests/test_import_hygiene.py. A wall-clock # assertion on a shared runner would just be a flaky test. - name: Report cold start run: | { echo '### Cold start' echo echo '```' uv run --no-sync python scripts/cold_start.py echo '```' } >> "$GITHUB_STEP_SUMMARY" plugin: name: Validate Plugin runs-on: ubuntu-latest steps: - name: Check out Repo uses: actions/checkout@v7 - name: Install uv uses: astral-sh/setup-uv@v10.0.1 with: version: "0.12.8" - name: Set up Python uses: actions/setup-python@v7 id: setup-python with: python-version-file: ".python-version" - name: Install python dependencies run: uv sync --locked --group test # `claude plugin validate` is what reads the marketplace entry and the # plugin manifest; the tests that call it skip where it is not installed, # which is everywhere but here. - name: Install the Claude Code CLI run: npm install -g @anthropic-ai/claude-code@2.1.251 - name: Validate the marketplace entry and the plugin it names run: uv run --no-sync pytest tests/unit_tests/test_plugin.py -n0