|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + acceptance: |
| 11 | + name: Lint conditions + acceptance suite |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Install Bun |
| 17 | + uses: oven-sh/setup-bun@v2 |
| 18 | + with: |
| 19 | + bun-version: latest |
| 20 | + |
| 21 | + - name: Run acceptance suite (lint --all) |
| 22 | + run: bun scripts/lint-condition.ts --all |
| 23 | + |
| 24 | + manifest: |
| 25 | + name: Validate plugin manifests |
| 26 | + runs-on: ubuntu-latest |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: Validate marketplace.json is parseable JSON |
| 31 | + run: | |
| 32 | + node -e "JSON.parse(require('fs').readFileSync('.claude-plugin/marketplace.json', 'utf8'))" |
| 33 | + echo "✓ marketplace.json is valid JSON" |
| 34 | +
|
| 35 | + - name: Validate plugin.json is parseable JSON |
| 36 | + run: | |
| 37 | + node -e "JSON.parse(require('fs').readFileSync('.claude-plugin/plugin.json', 'utf8'))" |
| 38 | + echo "✓ plugin.json is valid JSON" |
| 39 | +
|
| 40 | + - name: Verify required fields in plugin.json |
| 41 | + run: | |
| 42 | + node <<'EOF' |
| 43 | + const m = JSON.parse(require('fs').readFileSync('.claude-plugin/plugin.json', 'utf8')); |
| 44 | + const required = ['name', 'version', 'description', 'author', 'license']; |
| 45 | + const missing = required.filter(k => !(k in m)); |
| 46 | + if (missing.length) { console.error('Missing fields:', missing); process.exit(1); } |
| 47 | + console.log('✓ plugin.json has all required fields'); |
| 48 | + EOF |
| 49 | +
|
| 50 | + - name: Verify version consistency |
| 51 | + run: | |
| 52 | + node <<'EOF' |
| 53 | + const fs = require('fs'); |
| 54 | + const plugin = JSON.parse(fs.readFileSync('.claude-plugin/plugin.json', 'utf8')); |
| 55 | + const market = JSON.parse(fs.readFileSync('.claude-plugin/marketplace.json', 'utf8')); |
| 56 | + const marketVersion = market.metadata?.version || market.plugins?.[0]?.version; |
| 57 | + if (plugin.version !== marketVersion) { |
| 58 | + console.error(`Version mismatch: plugin.json=${plugin.version} marketplace.json=${marketVersion}`); |
| 59 | + process.exit(1); |
| 60 | + } |
| 61 | + console.log('✓ plugin.json and marketplace.json versions match:', plugin.version); |
| 62 | + EOF |
| 63 | +
|
| 64 | + markdown-links: |
| 65 | + name: Markdown link check |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v4 |
| 69 | + |
| 70 | + - name: Check internal markdown links |
| 71 | + uses: gaurav-nelson/github-action-markdown-link-check@v1 |
| 72 | + with: |
| 73 | + use-quiet-mode: 'yes' |
| 74 | + use-verbose-mode: 'yes' |
| 75 | + config-file: '.github/markdown-link-check.json' |
| 76 | + continue-on-error: false |
0 commit comments