mirror of
https://github.com/evdboom/Bindery.git
synced 2026-07-22 06:49:36 +00:00
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>
This commit is contained in:
parent
6430951444
commit
e53d1928d4
3 changed files with 80 additions and 105 deletions
69
.github/workflows/ci.yml
vendored
Normal file
69
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -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
|
||||
97
.github/workflows/test.yml
vendored
97
.github/workflows/test.yml
vendored
|
|
@ -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"
|
||||
|
|
@ -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.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue