Repository navigation
62 lines (59 loc) · 2.15 KB
/
Copy pathci.yml
File metadata and controls
62 lines (59 loc) · 2.15 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
name: CI
on:
push:
branches: [main, "feat/**"]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# node:sqlite is only unflagged from Node 22.13 / 23.4.
node-version: [22, 24]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm run build
- run: npm test
# The historical 979 V1 assertions. They re-implement the old JSON logic
# instead of importing the build, so they are a V1 reference, not coverage
# of this code; run them so the combined count is reproducible in CI.
- run: npm run test:legacy
# Confirms the built package loads and works when installed, rather than only
# from a workspace checkout.
packaged-install:
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: Pack and install into a clean project
run: |
npm pack --pack-destination /tmp
mkdir -p /tmp/consumer && cd /tmp/consumer
npm init -y
npm install /tmp/gitdamnit-checkpoint-orchestrator-*.tgz
node --input-type=module -e "
const plugin = (await import('@gitdamnit/checkpoint-orchestrator')).default
if (typeof plugin.setup !== 'function') throw new Error('default export is not a V2 plugin')
if (!plugin.id) throw new Error('plugin id missing')
console.log('packaged plugin loads:', plugin.id)
"
- name: Verify no development state is published
run: |
tar -tzf /tmp/gitdamnit-checkpoint-orchestrator-*.tgz > /tmp/contents.txt
! grep -E "\.db$|\.db-wal$|\.db-shm$|node_modules/|tests/|plugins/" /tmp/contents.txt
grep -q "package/dist/checkpoint-orchestrator.js" /tmp/contents.txt
grep -q "package/README.md" /tmp/contents.txt