| 1 |
name: "Perform Static Analysis" |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
workflow_dispatch: |
| 6 |
|
| 7 |
# will cancel previous workflows triggered by the same event and for the same ref for PRs or same SHA otherwise |
| 8 |
concurrency: |
| 9 |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }} |
| 10 |
cancel-in-progress: true |
| 11 |
|
| 12 |
jobs: |
| 13 |
static: |
| 14 |
name: Static Analysis |
| 15 |
runs-on: ubuntu-latest |
| 16 |
steps: |
| 17 |
- name: Check out Repo |
| 18 |
uses: actions/checkout@v7 |
| 19 |
|
| 20 |
- name: Install uv |
| 21 |
uses: astral-sh/[email protected] |
| 22 |
with: |
| 23 |
version: "0.12.13" |
| 24 |
|
| 25 |
- name: Set up Python |
| 26 |
uses: actions/setup-python@v7 |
| 27 |
id: setup-python |
| 28 |
with: |
| 29 |
python-version-file: ".python-version" |
| 30 |
|
| 31 |
- name: Install python dependencies |
| 32 |
run: uv sync --locked --group static --group test |
| 33 |
|
| 34 |
- name: Run analysis |
| 35 |
run: | |
| 36 |
uv run --no-sync ruff format . --diff |
| 37 |
uv run --no-sync ruff check . |
| 38 |
uv run --no-sync mypy --no-incremental |
| 39 |
uv run --no-sync lint-imports |
| 40 |
|
| 41 |
# Informational: the deterministic guards are the import-linter contracts |
| 42 |
# above and tests/unit_tests/test_import_hygiene.py. A wall-clock |
| 43 |
# assertion on a shared runner would just be a flaky test. |
| 44 |
- name: Report cold start |
| 45 |
run: | |
| 46 |
{ |
| 47 |
echo '### Cold start' |
| 48 |
echo |
| 49 |
echo '```' |
| 50 |
uv run --no-sync python scripts/cold_start.py |
| 51 |
echo '```' |
| 52 |
} >> "$GITHUB_STEP_SUMMARY" |
| 53 |
|
| 54 |
plugin: |
| 55 |
name: Validate Plugin |
| 56 |
runs-on: ubuntu-latest |
| 57 |
steps: |
| 58 |
- name: Check out Repo |
| 59 |
uses: actions/checkout@v7 |
| 60 |
|
| 61 |
- name: Install uv |
| 62 |
uses: astral-sh/[email protected] |
| 63 |
with: |
| 64 |
version: "0.12.13" |
| 65 |
|
| 66 |
- name: Set up Python |
| 67 |
uses: actions/setup-python@v7 |
| 68 |
id: setup-python |
| 69 |
with: |
| 70 |
python-version-file: ".python-version" |
| 71 |
|
| 72 |
- name: Install python dependencies |
| 73 |
run: uv sync --locked --group test |
| 74 |
|
| 75 |
# `claude plugin validate` is what reads the marketplace entry and the |
| 76 |
# plugin manifest; the tests that call it skip where it is not installed, |
| 77 |
# which is everywhere but here. |
| 78 |
- name: Install the Claude Code CLI |
| 79 |
run: npm install -g @anthropic-ai/[email protected] |
| 80 |
|
| 81 |
- name: Validate the marketplace entry and the plugin it names |
| 82 |
run: uv run --no-sync pytest tests/unit_tests/test_plugin.py -n0 |