chore(lessons): capture MCP path-containment + PR-fetch verification … #323
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| quality: | |
| name: Quality (Node ${{ matrix.node-version }} on ${{ matrix.os }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| node-version: 22 | |
| - os: ubuntu-latest | |
| node-version: 24 | |
| - os: macos-latest | |
| node-version: 22 | |
| - os: windows-latest | |
| node-version: 22 | |
| - os: windows-latest | |
| node-version: 24 | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Lint | |
| if: matrix.os == 'ubuntu-latest' && matrix.node-version == 22 | |
| run: pnpm lint | |
| - name: Typecheck | |
| run: pnpm typecheck | |
| # Build BEFORE tests — `pnpm test` includes integration tests | |
| # (import.integration.test.ts, watch.integration.test.ts, plugin-flow, | |
| # generate-process-lock) that exec `dist/cli.js`. Without this build | |
| # they fail on a fresh CI runner with `Cannot find module dist/cli.js`. | |
| - name: Build | |
| run: pnpm build | |
| - name: Unit and integration tests | |
| run: pnpm test | |
| - name: E2E tests | |
| run: pnpm test:e2e | |
| coverage: | |
| name: Coverage & contract checks | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Audit production dependencies | |
| run: pnpm audit --prod --audit-level=high | |
| # Coverage runs the full vitest suite, which includes integration tests | |
| # that exec `dist/cli.js`. Build first so those tests can find the binary. | |
| - name: Build | |
| run: pnpm build | |
| - name: Contract matrix | |
| run: pnpm test:contract | |
| - name: Builtin target catalog drift guard | |
| run: pnpm catalog:verify | |
| - name: Support matrix docs match catalog | |
| run: pnpm matrix:verify | |
| - name: Coverage | |
| run: pnpm test:coverage | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage/lcov.info | |
| fail_ci_if_error: false | |
| smoke: | |
| name: Post-pack smoke test | |
| needs: quality | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm build | |
| - name: Pack tarball | |
| run: pnpm pack | |
| - name: Install packed tarball globally | |
| run: npm install -g ./agentsmesh-*.tgz | |
| - name: Verify CLI entrypoints | |
| run: | | |
| agentsmesh --version | |
| agentsmesh --help | |
| amsh --version | |
| - name: Verify init scaffold in clean temp project | |
| run: | | |
| set -eux | |
| SMOKE_DIR=$(mktemp -d) | |
| cd "$SMOKE_DIR" | |
| agentsmesh init --yes | |
| test -f agentsmesh.yaml | |
| test -d .agentsmesh | |
| - name: publint (package metadata) | |
| run: pnpm publint | |
| - name: arethetypeswrong (types resolution under node16/bundler) | |
| run: pnpm attw | |
| - name: Consumer smoke (strict-mode TS import from packed tarball) | |
| run: ./scripts/consumer-smoke.sh | |
| build-binaries: | |
| name: Build cross-compiled binaries | |
| needs: quality | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.2" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm build | |
| - name: Cross-compile all five distributed binaries | |
| # Same shape as the release workflow. CI catches a broken Bun bundle | |
| # before it can ship; the release workflow re-runs this exact command | |
| # set with the real version baked in. | |
| run: | | |
| mkdir -p dist-bin | |
| bun build --compile --minify --define "globalThis.__AGENTSMESH_VERSION__='ci-test'" --target=bun-linux-x64 --outfile=dist-bin/agentsmesh-linux-x64 dist/cli.js | |
| bun build --compile --minify --define "globalThis.__AGENTSMESH_VERSION__='ci-test'" --target=bun-linux-arm64 --outfile=dist-bin/agentsmesh-linux-arm64 dist/cli.js | |
| bun build --compile --minify --define "globalThis.__AGENTSMESH_VERSION__='ci-test'" --target=bun-darwin-x64 --outfile=dist-bin/agentsmesh-darwin-x64 dist/cli.js | |
| bun build --compile --minify --define "globalThis.__AGENTSMESH_VERSION__='ci-test'" --target=bun-darwin-arm64 --outfile=dist-bin/agentsmesh-darwin-arm64 dist/cli.js | |
| bun build --compile --minify --define "globalThis.__AGENTSMESH_VERSION__='ci-test'" --target=bun-windows-x64 --outfile=dist-bin/agentsmesh-windows-x64.exe dist/cli.js | |
| ls -la dist-bin | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: agentsmesh-binaries | |
| path: dist-bin/ | |
| retention-days: 7 | |
| smoke-binaries: | |
| name: Smoke ${{ matrix.binary }} on ${{ matrix.os }} | |
| needs: build-binaries | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| binary: agentsmesh-linux-x64 | |
| - os: ubuntu-24.04-arm | |
| binary: agentsmesh-linux-arm64 | |
| - os: macos-latest | |
| binary: agentsmesh-darwin-x64 | |
| - os: macos-latest | |
| binary: agentsmesh-darwin-arm64 | |
| - os: windows-latest | |
| binary: agentsmesh-windows-x64.exe | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: agentsmesh-binaries | |
| path: dist-bin | |
| - name: Smoke-test the binary on its target OS | |
| shell: bash | |
| run: | | |
| set -eux | |
| BIN="$(pwd)/dist-bin/${{ matrix.binary }}" | |
| # NTFS doesn't carry POSIX execute bits — chmod is a no-op on Windows | |
| # and required everywhere else after actions/download-artifact strips them. | |
| chmod +x "$BIN" 2>/dev/null || true | |
| # Boot check: catches bundling, native-module, or runtime-API regressions. | |
| "$BIN" --version | |
| SMOKE_DIR=$(mktemp -d) | |
| cd "$SMOKE_DIR" | |
| # Filesystem write path: catches POSIX-vs-Windows path bugs in init/scaffold. | |
| "$BIN" init --yes | |
| test -f agentsmesh.yaml | |
| test -f .agentsmesh/rules/_root.md | |
| # Full pipeline: catches descriptor / generate / link-rebase regressions. | |
| "$BIN" generate | |
| "$BIN" check |