|
| 1 | +name: Claude install smoke |
| 2 | + |
| 3 | +# Real Claude Code install smoke (spec AC-001–AC-007, milestone AC-022). |
| 4 | +# Installs ADD through the actual marketplace path — `claude plugin marketplace |
| 5 | +# add <checkout>` + `claude plugin install add@add-marketplace` — so the commit |
| 6 | +# under test is what gets installed, then drives a headless session through |
| 7 | +# /add:init --quick in a scratch project. |
| 8 | +# |
| 9 | +# Auth (AC-007): the agent-driven leg needs ANTHROPIC_API_KEY. When the secret |
| 10 | +# is absent (fork PRs), the install/discovery assertions still run and gate; |
| 11 | +# the agent leg skips with a loud workflow warning. |
| 12 | + |
| 13 | +on: |
| 14 | + pull_request: |
| 15 | + branches: [main] |
| 16 | + push: |
| 17 | + branches: [main] |
| 18 | + tags: ['v*'] |
| 19 | + workflow_dispatch: |
| 20 | + |
| 21 | +jobs: |
| 22 | + smoke: |
| 23 | + name: Claude install smoke |
| 24 | + runs-on: ubuntu-latest |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v5 |
| 27 | + |
| 28 | + - uses: actions/setup-node@v4 |
| 29 | + with: |
| 30 | + node-version: '22' |
| 31 | + |
| 32 | + - name: Install Claude Code CLI |
| 33 | + run: | |
| 34 | + npm install -g @anthropic-ai/claude-code |
| 35 | + claude --version |
| 36 | +
|
| 37 | + - name: Marketplace install from this checkout (AC-002) |
| 38 | + run: | |
| 39 | + claude plugin marketplace add "$GITHUB_WORKSPACE" |
| 40 | + claude plugin install add@add-marketplace |
| 41 | +
|
| 42 | + - name: Assert skill discovery (AC-004) |
| 43 | + run: | |
| 44 | + EXPECTED=$(find plugins/add/skills -maxdepth 1 -mindepth 1 -type d | wc -l | tr -d ' ') |
| 45 | + CACHE_DIR=$(find ~/.claude/plugins -type d -name skills -path '*add*' | head -1) |
| 46 | + if [ -z "$CACHE_DIR" ]; then |
| 47 | + echo "::error::installed plugin skills directory not found under ~/.claude/plugins" |
| 48 | + exit 1 |
| 49 | + fi |
| 50 | + INSTALLED=$(find "$CACHE_DIR" -maxdepth 1 -mindepth 1 -type d | wc -l | tr -d ' ') |
| 51 | + echo "expected=$EXPECTED installed=$INSTALLED ($CACHE_DIR)" |
| 52 | + [ "$INSTALLED" = "$EXPECTED" ] || { echo "::error::skill count mismatch"; exit 1; } |
| 53 | +
|
| 54 | + - name: Agent-driven /add:init smoke (AC-003, AC-005) |
| 55 | + env: |
| 56 | + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
| 57 | + run: | |
| 58 | + if [ -z "$ANTHROPIC_API_KEY" ]; then |
| 59 | + echo "::warning title=Claude smoke partial::install/discovery assertions ran; agent-driven /add:init skipped (no ANTHROPIC_API_KEY — expected on fork PRs)" |
| 60 | + exit 0 |
| 61 | + fi |
| 62 | + SCRATCH=$(mktemp -d) |
| 63 | + cd "$SCRATCH" |
| 64 | + git init -q |
| 65 | + set +e |
| 66 | + claude -p "/add:init --quick" \ |
| 67 | + --permission-mode acceptEdits \ |
| 68 | + --max-turns 30 \ |
| 69 | + > "$SCRATCH/session.log" 2>&1 |
| 70 | + STATUS=$? |
| 71 | + set -e |
| 72 | + echo "--- session tail ---" |
| 73 | + tail -40 "$SCRATCH/session.log" |
| 74 | + if [ ! -f .add/config.json ]; then |
| 75 | + echo "::error::/add:init --quick did not produce .add/config.json (claude exit $STATUS)" |
| 76 | + exit 1 |
| 77 | + fi |
| 78 | + # No config schema exists in core/schemas yet (spec deviation, recorded |
| 79 | + # in specs/install-path-confirmation.md) — assert parse + key fields. |
| 80 | + python3 -c "import json,sys; c=json.load(open('.add/config.json')); sys.exit(0 if ('version' in c and 'maturity' in c) else 1)" \ |
| 81 | + || { echo "::error::.add/config.json missing version/maturity keys"; exit 1; } |
| 82 | + echo "PASS: .add/config.json produced and well-formed" |
| 83 | + # AC-005 (Should, non-blocking): SessionStart rule loading evidence. |
| 84 | + if grep -qi "add.*rules\|load-rules" "$SCRATCH/session.log"; then |
| 85 | + echo "PASS: rule-loading evidence found in session output" |
| 86 | + else |
| 87 | + echo "::warning::no rule-loading evidence in session output (AC-005 soft check)" |
| 88 | + fi |
0 commit comments