Repository navigation
69 lines (60 loc) · 2.08 KB
/
Copy pathci.yml
File metadata and controls
69 lines (60 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CI
on:
push:
branches: [master, main]
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [18, 20, 22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
# `prepare` runs on install and builds dist/, so the tests have something
# to import. `npm run build` after it also surfaces type errors on their own.
- run: npm ci
- run: npm run build
- run: npm test
package:
# Catches the mistake that only shows up at publish time: a file that works
# locally but is missing from the published tarball because of `files`.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run build
- name: Inspect publish tarball
run: npm pack --dry-run
- name: Fail if the CLI or MCP entry point is missing from the tarball
run: |
npm pack --dry-run --json > /tmp/pack.json
for f in dist/cli.js dist/mcp/server.js themes/classic.css themes/compact.css; do
if ! grep -q "\"$f\"" /tmp/pack.json; then
echo "::error::$f is missing from the published package"
exit 1
fi
done
echo "All required files are present in the tarball."
- name: Smoke-test the built CLI
run: |
node dist/cli.js --help > /dev/null
node dist/cli.js lint test/fixtures/bad-cv.md --json > /tmp/lint.json
node -e "
const f = require('/tmp/lint.json');
const rules = new Set(f.map(x => x.rule));
for (const r of ['over-claim', 'under-claim', 'tense', 'duplicate']) {
if (!rules.has(r)) { console.error('missing rule in output: ' + r); process.exit(1); }
}
console.log('CLI smoke test passed, ' + f.length + ' findings.');
"