-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (67 loc) · 2.54 KB
/
Copy pathci.yml
File metadata and controls
76 lines (67 loc) · 2.54 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
70
71
72
73
74
75
76
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build --concurrency=2
- run: pnpm lint --concurrency=2
- run: pnpm typecheck --concurrency=2
- run: pnpm test --concurrency=2
- name: Verify all packages built
run: |
fail=0
for pkg in packages/*/; do
name=$(basename "$pkg")
if [ "$name" = "config-ts" ] || [ "$name" = "config-tailwind" ]; then continue; fi
if [ ! -d "$pkg/dist" ]; then
echo "::error::Package $name has no dist/ after build"
fail=1
fi
done
exit $fail
- name: Smoke test CLI
run: |
mkdir /tmp/smoke && cd /tmp/smoke
pnpm init
pnpm add $GITHUB_WORKSPACE/packages/cli
test -f node_modules/.bin/nullsec || (echo "CLI bin not linked"; exit 1)
./node_modules/.bin/nullsec --version
./node_modules/.bin/nullsec --help | grep -q "dev"
./node_modules/.bin/nullsec --help | grep -q "approve"
./node_modules/.bin/nullsec --help | grep -q "mcp"
./node_modules/.bin/nullsec --help | grep -q "policy"
./node_modules/.bin/nullsec init --yes
./node_modules/.bin/nullsec policy validate
./node_modules/.bin/nullsec run -- rm -rf . || code=$?; if [ "${code:-0}" != "2" ]; then echo "Expected exit 2, got ${code:-0}"; exit 1; fi
./node_modules/.bin/nullsec verify
- name: Approval round-trip test
run: |
cd /tmp/smoke
./node_modules/.bin/nullsec dev > /tmp/dev.log 2>&1 &
DEV_PID=$!
sleep 2
curl -sf http://127.0.0.1:7676/timeline > /dev/null
./node_modules/.bin/nullsec run -- git push origin main > /tmp/run.log 2>&1 &
RUN_PID=$!
sleep 2
ACTION_ID=$(grep -oP 'http://127.0.0.1:7676/approvals/\K[a-f0-9-]+' /tmp/run.log | head -1)
if [ -z "$ACTION_ID" ]; then echo "No action ID found in run log"; cat /tmp/run.log; exit 1; fi
./node_modules/.bin/nullsec approve "$ACTION_ID"
sleep 2
kill $DEV_PID 2>/dev/null || true
./node_modules/.bin/nullsec verify