Zion Boggan
repos/TreeTrace/.github/workflows/ci.yml
zionboggan.com ↗
45 lines · yaml
History for this file →
1
name: ci
2
on:
3
  push:
4
    branches: [main]
5
  pull_request:
6
 
7
jobs:
8
  test:
9
    runs-on: ubuntu-latest
10
    strategy:
11
      matrix:
12
        node: [18, 20, 22]
13
    steps:
14
      - uses: actions/checkout@v4
15
      - uses: actions/setup-node@v4
16
        with:
17
          node-version: ${{ matrix.node }}
18
      - run: node --test test/treetrace.test.js test/adapters.test.js
19
      - name: CLI smoke test (fixture, fail-closed redaction)
20
        run: |
21
          node bin/treetrace.js --file test/fixtures/synthetic-session.jsonl --dir "$RUNNER_TEMP" --redact-auto --quiet
22
          grep -q "REDACTED" "$RUNNER_TEMP/PROMPT_TREE.md"
23
          ! grep -q "sk-ant-" "$RUNNER_TEMP/PROMPT_TREE.md"
24
 
25
  package:
26
    runs-on: ubuntu-latest
27
    steps:
28
      - uses: actions/checkout@v4
29
      - uses: actions/setup-node@v4
30
        with:
31
          node-version: 20
32
      - name: bin is executable after checkout
33
        run: test -x bin/treetrace.js
34
      - name: direct execution works
35
        run: ./bin/treetrace.js --version
36
      - name: pack and install the tarball into a temp project
37
        run: |
38
          set -euo pipefail
39
          TARBALL="$(npm pack --silent)"
40
          APP="$RUNNER_TEMP/consumer"
41
          mkdir -p "$APP"
42
          cd "$APP"
43
          npm init -y >/dev/null 2>&1
44
          npm install "$GITHUB_WORKSPACE/$TARBALL"
45
          npx --no-install treetrace --version