-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (69 loc) · 2.82 KB
/
Copy pathtest.yml
File metadata and controls
81 lines (69 loc) · 2.82 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
77
78
79
80
81
# Cross-platform CI for pi-agenticoding
#
# Runs the full unit suite on Linux, macOS, and Windows
# on the minimum Node.js version required by pi coding agent. Snapshot
# tests verify TUI render output against golden files.
name: test
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main]
paths-ignore: ['*.md', '**/docs/**']
pull_request:
branches: [main]
paths-ignore: ['*.md', '**/docs/**']
jobs:
# ── Cross-platform test matrix ──────────────────────────────────────
# Node 22 (minimum) is tested only on Linux — the primary platform and the only one
# guaranteed to have the oldest toolchain. macOS and Windows test Node 24 (latest)
# to catch regressions in the newest runtime. This asymmetry is intentional: it
# balances CI cost with meaningful coverage while ensuring the minimum version works
# correctly on the platform most likely to encounter toolchain edge cases.
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # report every combination, don't cancel
matrix:
include:
- os: ubuntu-latest
node-version: "22" # minimum version on primary platform
- os: ubuntu-latest
node-version: "24" # latest on primary platform
- os: macos-latest
node-version: "24" # latest on macOS
- os: windows-latest
node-version: "24" # latest on Windows
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
# Uniform pre-flight checks — type errors and security issues on every platform
- name: Type check
run: npx tsc --noEmit
- name: Security audit
run: npm audit --audit-level=moderate
# Unit suite (unit tests + snapshot tests + property-based tests)
- name: Unit tests
run: npm test
# E2E tests — process-isolated child-process harness (stdin/stdout, no PTY).
# Verified cross-platform: runs on Linux, macOS, and Windows.
# See https://github.com/agenticoding/pi-agenticoding/issues/12
- name: E2E tests
run: npm run test:e2e
# Upload test results for debugging — artifacts available for 30 days.
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}-node-${{ matrix.node-version }}
path: |
test-results/
tests/__snapshots__/
retention-days: 30