From e53d1928d4c8df1a6eb27865c16a2cb308408fc3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 22:29:46 +0000 Subject: [PATCH] Merge test.yml into existing ci.yml; upgrade to Node 22 and test:ci Agent-Logs-Url: https://github.com/evdboom/Bindery/sessions/7d0c6a23-b1e9-47c1-af83-c40760a7f63a Co-authored-by: evdboom <18037882+evdboom@users.noreply.github.com> --- .github/workflows/ci.yml | 69 +++++++++++++++++++++++++++ .github/workflows/test.yml | 97 -------------------------------------- CONTRIBUTING.md | 19 ++++---- 3 files changed, 80 insertions(+), 105 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..154ab3b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: CI + +on: + push: + branches: ['**'] + pull_request: + branches: ['**'] + +permissions: + contents: read + +jobs: + test: + name: Test & template-sync check + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + cache-dependency-path: | + mcp-ts/package-lock.json + vscode-ext/package-lock.json + + # ── MCP server ──────────────────────────────────────────────────────────── + - name: Install mcp-ts dependencies + run: cd mcp-ts && npm ci + + - name: Compile mcp-ts + run: cd mcp-ts && npm run compile + + - name: Run mcp-ts tests + run: cd mcp-ts && npm run test:ci + + - name: Upload mcp-ts test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: mcp-test-results + path: mcp-ts/test-results.json + + # ── Template sync ───────────────────────────────────────────────────────── + # ai-setup-templates.ts is .gitignored — always generated fresh here. + # The copy-parity test in mcp-ts/test/templates-parity.test.ts then confirms + # the synced file is byte-for-byte identical to the source. + - name: Sync templates to vscode-ext + run: | + cp mcp-ts/src/templates.ts vscode-ext/src/ai-setup-templates.ts + echo "Template copy synced." + + # ── VS Code extension ───────────────────────────────────────────────────── + - name: Install vscode-ext dependencies + run: cd vscode-ext && npm ci + + - name: Compile vscode-ext + run: cd vscode-ext && npm run compile + + - name: Run vscode-ext tests + run: cd vscode-ext && npm run test:ci + + - name: Upload vscode-ext test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: vscode-ext-test-results + path: vscode-ext/test-results.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index f59858d..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Test - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - # ── MCP server tests ────────────────────────────────────────────────────────── - test-mcp: - name: MCP server tests - runs-on: ubuntu-latest - permissions: - contents: read - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: 'npm' - cache-dependency-path: mcp-ts/package-lock.json - - - name: Install dependencies - run: npm ci - working-directory: mcp-ts - - - name: Build - run: npm run build - working-directory: mcp-ts - - - name: Run tests - run: npm run test:ci - working-directory: mcp-ts - - - name: Upload test results - if: always() - uses: actions/upload-artifact@v4 - with: - name: mcp-test-results - path: mcp-ts/test-results.json - - # ── VS Code extension tests ─────────────────────────────────────────────────── - test-vscode-ext: - name: VS Code extension tests - runs-on: ubuntu-latest - permissions: - contents: read - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: 'npm' - cache-dependency-path: vscode-ext/package-lock.json - - - name: Install dependencies - run: npm ci - working-directory: vscode-ext - - - name: Build - run: npm run compile - working-directory: vscode-ext - - - name: Run tests - run: npm run test:ci - working-directory: vscode-ext - - - name: Upload test results - if: always() - uses: actions/upload-artifact@v4 - with: - name: vscode-ext-test-results - path: vscode-ext/test-results.json - - # ── Aggregate status check ──────────────────────────────────────────────────── - status-check: - name: All tests passed - runs-on: ubuntu-latest - needs: [test-mcp, test-vscode-ext] - if: always() - permissions: {} - - steps: - - name: Report status - run: | - if [[ "${{ needs.test-mcp.result }}" != "success" || "${{ needs.test-vscode-ext.result }}" != "success" ]]; then - echo "❌ Tests failed" - echo " test-mcp: ${{ needs.test-mcp.result }}" - echo " test-vscode-ext: ${{ needs.test-vscode-ext.result }}" - exit 1 - fi - echo "✅ All tests passed" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7acec51..ee96a94 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,19 +74,22 @@ Tests cover: --- -## CI pipeline (`.github/workflows/test.yml`) +## CI pipeline (`.github/workflows/ci.yml`) -The workflow runs on every push to `main` and on all pull requests targeting `main`. +The workflow runs on every push and pull request on all branches. -Jobs: +A single `test` job runs the steps sequentially (the template-sync step must +occur between the mcp-ts and vscode-ext builds): -| Job | What it does | +| Step | What it does | |---|---| -| `test-mcp` | Install → build → `npm run test:ci` in `mcp-ts/` | -| `test-vscode-ext` | Install → compile → `npm run test:ci` in `vscode-ext/` | -| `status-check` | Aggregates both results; fails if either package fails | +| Install + compile mcp-ts | `npm ci` → `npm run compile` | +| Run mcp-ts tests | `npm run test:ci` → uploads `test-results.json` artifact | +| Sync templates | Copies `mcp-ts/src/templates.ts` → `vscode-ext/src/ai-setup-templates.ts` | +| Install + compile vscode-ext | `npm ci` → `npm run compile` | +| Run vscode-ext tests | `npm run test:ci` → uploads `test-results.json` artifact | -PRs **cannot be merged** unless both `test-mcp` and `test-vscode-ext` pass. +PRs **cannot be merged** unless the `test` job passes. ---