-
Notifications
You must be signed in to change notification settings - Fork 2
145 lines (128 loc) · 5.9 KB
/
Copy pathtest.yml
File metadata and controls
145 lines (128 loc) · 5.9 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# 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/**']
workflow_dispatch:
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.19.0" # exact supported floor 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.
# audit-ci fails on moderate-or-higher advisories; reviewed exceptions, if ever
# needed, must be explicit and expiry-tracked in audit-ci.jsonc.
- name: Type check
run: npx tsc --noEmit
- name: Security audit
run: npx audit-ci --config audit-ci.jsonc
# 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
# The packed extension is exercised from a foreign cwd with the latest host.
- name: Packed latest Pi host contract
if: (matrix.os == 'ubuntu-latest' && matrix.node-version == '22.19.0') || matrix.os == 'windows-latest'
working-directory: ${{ runner.temp }}
env:
COMPAT_ARTIFACT_DIR: ${{ runner.temp }}/packed-host-diagnostics-${{ matrix.os }}-node-${{ matrix.node-version }}
run: node "${{ github.workspace }}/scripts/test-package-host.mjs"
- name: Upload packed host diagnostics
if: always() && ((matrix.os == 'ubuntu-latest' && matrix.node-version == '22.19.0') || matrix.os == 'windows-latest')
uses: actions/upload-artifact@v4
with:
name: packed-host-diagnostics-${{ matrix.os }}-node-${{ matrix.node-version }}-attempt-${{ github.run_attempt }}
path: ${{ runner.temp }}/packed-host-diagnostics-${{ matrix.os }}-node-${{ matrix.node-version }}
if-no-files-found: warn
overwrite: true
retention-days: 30
# Runs even when the packed-host contract step fails on Windows, so compat
# diagnostics are captured for both the packed and current-Pi paths. !cancelled()
# (not always()) avoids running on explicit workflow cancellation.
- name: Synchronized current Pi compatibility on Windows
if: matrix.os == 'windows-latest' && !cancelled()
working-directory: ${{ runner.temp }}
env:
COMPAT_ARTIFACT_DIR: ${{ runner.temp }}/current-pi-diagnostics-windows-node-24
run: node "${{ github.workspace }}/scripts/test-compat-current.mjs"
- name: Upload current Pi diagnostics on Windows
if: always() && matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: current-pi-diagnostics-windows-node-24-attempt-${{ github.run_attempt }}
path: ${{ runner.temp }}/current-pi-diagnostics-windows-node-24
if-no-files-found: warn
overwrite: true
retention-days: 30
# 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: |
tests/snapshots/
retention-days: 30
current-pi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
cache: "npm"
- run: npm ci
- name: Synchronized current Pi compatibility
working-directory: ${{ runner.temp }}
env:
COMPAT_ARTIFACT_DIR: ${{ runner.temp }}/current-pi-diagnostics-ubuntu-node-24
run: node "${{ github.workspace }}/scripts/test-compat-current.mjs"
- name: Upload current Pi diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: current-pi-diagnostics-ubuntu-node-24-attempt-${{ github.run_attempt }}
path: ${{ runner.temp }}/current-pi-diagnostics-ubuntu-node-24
if-no-files-found: warn
overwrite: true
retention-days: 30