|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + build-test-package: |
| 18 | + name: Lint, build, test, package |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 23 | + |
| 24 | + - name: Set up Node |
| 25 | + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 |
| 26 | + with: |
| 27 | + node-version-file: .nvmrc |
| 28 | + cache: npm |
| 29 | + |
| 30 | + - name: Install root/extension dependencies (exact, from lockfile) |
| 31 | + run: npm ci |
| 32 | + |
| 33 | + - name: Install webview dependencies (exact, from lockfile) |
| 34 | + run: npm ci |
| 35 | + working-directory: vscode-acp/webview-ui |
| 36 | + |
| 37 | + - name: Release invariants (SETUP-*, DOC-*, FINAL-*) |
| 38 | + run: bash scripts/check-release-invariants.sh |
| 39 | + |
| 40 | + - name: Lint |
| 41 | + run: npm run lint |
| 42 | + working-directory: vscode-acp |
| 43 | + |
| 44 | + - name: Compile test harness |
| 45 | + run: npm run compile-tests |
| 46 | + working-directory: vscode-acp |
| 47 | + |
| 48 | + - name: Compile extension |
| 49 | + run: npm run compile |
| 50 | + working-directory: vscode-acp |
| 51 | + |
| 52 | + - name: Build webview bundle |
| 53 | + run: npm run build |
| 54 | + working-directory: vscode-acp/webview-ui |
| 55 | + |
| 56 | + - name: Extension tests (VS Code, headless via xvfb) |
| 57 | + run: xvfb-run -a npm test |
| 58 | + working-directory: vscode-acp |
| 59 | + |
| 60 | + - name: npm audit — extension host (production dependencies) |
| 61 | + run: npm audit --omit=dev |
| 62 | + |
| 63 | + - name: npm audit — webview (production dependencies) |
| 64 | + run: npm audit --omit=dev |
| 65 | + working-directory: vscode-acp/webview-ui |
| 66 | + |
| 67 | + - name: THIRD-PARTY-NOTICES is up to date with the installed tree |
| 68 | + run: node ../scripts/generate-third-party-notices.mjs --check |
| 69 | + working-directory: vscode-acp |
| 70 | + |
| 71 | + - name: Package .vsix |
| 72 | + run: npm run copy:profiles && npm run copy:legal && npm run package:ext && npx vsce package --no-dependencies |
| 73 | + working-directory: vscode-acp |
| 74 | + |
| 75 | + - name: Upload .vsix artifact |
| 76 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 77 | + with: |
| 78 | + name: ainxt-vscode-extension |
| 79 | + path: vscode-acp/*.vsix |
| 80 | + if-no-files-found: error |
| 81 | + |
| 82 | + mermaid-render-check: |
| 83 | + name: Mermaid diagrams render (DOC-021) |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - name: Checkout |
| 87 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 88 | + |
| 89 | + - name: Set up Node |
| 90 | + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 |
| 91 | + with: |
| 92 | + node-version-file: .nvmrc |
| 93 | + |
| 94 | + # mermaid and puppeteer are deliberately not repository dependencies (see |
| 95 | + # scripts/check-mermaid-renders.mjs) — install them into a scratch directory |
| 96 | + # instead of the tracked node_modules tree. |
| 97 | + - name: Install mermaid + puppeteer into a scratch directory |
| 98 | + run: | |
| 99 | + mkdir -p /tmp/mermaid-scratch |
| 100 | + cd /tmp/mermaid-scratch |
| 101 | + npm init -y >/dev/null |
| 102 | + npm install mermaid puppeteer |
| 103 | +
|
| 104 | + - name: Render every mermaid block in tracked markdown |
| 105 | + run: node scripts/check-mermaid-renders.mjs --mermaid /tmp/mermaid-scratch/node_modules/mermaid/dist/mermaid.min.js |
0 commit comments