66 pull_request :
77 branches : [main]
88
9- jobs :
10- build :
11- runs-on : ubuntu-latest
9+ permissions :
10+ contents : read
11+
12+ concurrency :
13+ group : ci-${{ github.ref }}
14+ cancel-in-progress : true
1215
16+ jobs :
17+ test :
18+ name : test (${{ matrix.os }}, node ${{ matrix.node }})
19+ runs-on : ${{ matrix.os }}
20+ timeout-minutes : 25
21+ strategy :
22+ fail-fast : false
23+ matrix :
24+ os : [ubuntu-latest, windows-latest]
25+ node : ['22.x', '24.x']
26+ include :
27+ - os : macos-latest
28+ node : ' 24.x'
1329 steps :
14- - uses : actions/checkout@v3
30+ - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31+ with :
32+ persist-credentials : false
1533
16- - name : Use Node.js
17- uses : actions/setup-node@v3
34+ - uses : actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
1835 with :
19- node-version : ' 20.x '
20- cache : ' npm'
36+ node-version : ${{ matrix.node }}
37+ cache : npm
2138
22- - name : Install dependencies
39+ - name : Install (clean, from lockfile)
2340 run : npm ci
2441
25- - name : Build
26- run : npm run build
42+ - name : Lockfile unchanged by install
43+ shell : bash
44+ run : git diff --exit-code -- package-lock.json package.json
2745
2846 - name : Lint
2947 run : npm run lint
3048
31- - name : Test
32- run : npm test
49+ - name : Typecheck
50+ run : npm run typecheck
51+
52+ - name : Build from a clean state
53+ run : |
54+ npm run clean
55+ npm run build
56+
57+ - name : Tool docs match the registry
58+ run : npm run docs:check
59+
60+ - name : Tests (unit + stdio/HTTP integration, no network)
61+ run : npm test
62+
63+ - name : Pack
64+ shell : bash
65+ run : |
66+ npm pack --json > pack.json
67+ node -e "const p=require('./pack.json')[0];console.log(p.filename, p.integrity, p.entryCount + ' files')"
68+
69+ - name : Package gate (install tarball outside the repo, run MCP tests against its bin)
70+ shell : bash
71+ run : node scripts/package-smoke.mjs --tarball "$(node -p "require('./pack.json')[0].filename")" --report package-smoke-report.json
72+
73+ - name : Upload package report
74+ if : always()
75+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
76+ with :
77+ name : package-report-${{ matrix.os }}-node${{ matrix.node }}
78+ path : |
79+ pack.json
80+ package-smoke-report.json
81+ if-no-files-found : ignore
82+
83+ audit :
84+ name : production dependency audit
85+ runs-on : ubuntu-latest
86+ timeout-minutes : 10
87+ steps :
88+ - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
89+ with :
90+ persist-credentials : false
91+ - uses : actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
92+ with :
93+ node-version : ' 24.x'
94+ cache : npm
95+ - run : npm ci
96+ - name : npm audit (runtime dependencies, high and above)
97+ run : npm audit --omit=dev --audit-level=high
0 commit comments