From 1f0355e11888853d5ed8871c072e7c2eea784bc3 Mon Sep 17 00:00:00 2001 From: Imran Siddique Date: Thu, 16 Jul 2026 10:30:37 -0700 Subject: [PATCH] ci(claude-code): run the plugin test suite on PRs and pushes The plugin's pytest suite was never executed by CI: validate.yml only checks integration.yaml schemas under integrations/ and does not touch claude-code/, so every regression test added only ran when someone ran it by hand. Adds a workflow (triggered on claude-code/** changes) with two jobs: - stdlib: pytest with NO crypto packages, asserting the SessionStart hook and drift check work on the standard library alone (signing tests skip via importorskip; an accidental dependency on them fails the build). - signing: pip install -r requirements.txt then the full suite across Python 3.11 / 3.12 / 3.13, exercising the sign / publish / verify path. Verified locally: stdlib env -> 13 passed, 2 skipped; crypto env -> 15 passed. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/claude-code-tests.yml | 54 +++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/claude-code-tests.yml diff --git a/.github/workflows/claude-code-tests.yml b/.github/workflows/claude-code-tests.yml new file mode 100644 index 0000000..b10a55c --- /dev/null +++ b/.github/workflows/claude-code-tests.yml @@ -0,0 +1,54 @@ +name: claude-code tests + +on: + pull_request: + paths: + - "claude-code/**" + - ".github/workflows/claude-code-tests.yml" + push: + branches: [main] + paths: + - "claude-code/**" + - ".github/workflows/claude-code-tests.yml" + +permissions: + contents: read + +jobs: + # The SessionStart hook and drift check must work with the standard library + # alone. This job installs no crypto packages, so the signing tests skip and + # any accidental dependency on them fails the build. + stdlib: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + with: + python-version: "3.12" + - name: Run stdlib-only tests (no crypto packages) + working-directory: claude-code + run: | + pip install pytest + python -m pytest tests -q + + # Full suite including the signing / verification tests, which need the crypto + # packages from requirements.txt. + signing: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11", "3.12", "3.13"] + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + with: + python-version: ${{ matrix.python-version }} + - name: Run full suite (with crypto packages) + working-directory: claude-code + run: | + pip install pytest -r requirements.txt + python -m pytest tests -q