Repository navigation
56 lines (52 loc) · 1.76 KB
/
Copy pathci.yml
File metadata and controls
56 lines (52 loc) · 1.76 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
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
build:
name: Node ${{ matrix.node }} · ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [22, 24]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm run typecheck
- run: npm run build
- run: npm test
# Smoke test: the CLI must at least print help on every OS/Node combo.
- run: node ./bin/run.js --help
- run: node ./bin/run.js db --help
package:
name: Package contents
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
- run: npm ci
- name: npm pack --dry-run
run: |
npm pack --dry-run --json 2>/dev/null > pack.json
node -e "
const s = require('fs').readFileSync('pack.json', 'utf8');
const p = JSON.parse(s.slice(s.indexOf('[')))[0];
console.log('Tarball:', (p.size / 1024).toFixed(1), 'KB,', p.files.length, 'files');
const paths = p.files.map((f) => f.path);
if (!paths.includes('oclif.manifest.json')) { console.error('::error::oclif.manifest.json missing from the package'); process.exit(1); }
const leaked = paths.filter((f) => /^(src|test|tests|scripts|docs|\.github)\//.test(f));
if (leaked.length) { console.error('::error::Files that must not ship:', leaked); process.exit(1); }
"
- run: npm audit --omit=dev --audit-level=high