-
Notifications
You must be signed in to change notification settings - Fork 805
75 lines (63 loc) · 2.32 KB
/
Copy pathtest.yml
File metadata and controls
75 lines (63 loc) · 2.32 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
name: test
# Runs the Node test suite on every PR and on pushes to main. Originally
# Ubuntu-only (#198): PR checks were Cursor Bugbot + Security, neither of
# which runs `npm test`, so a green PR did NOT mean the tests passed.
#
# This workflow now also runs the suite on Windows + macOS via a second job
# (test-cross). #198 explicitly flagged Windows / macOS as a follow-up: the
# suite still has Linux-specific assumptions (symlink reliance, hard-coded
# ~/.volta layout, POSIX-style path equality) that would fail on those
# hosts. test-cross runs on PRs in **advisory** mode (continue-on-error)
# so those red signals are visible to reviewers without blocking merge
# while the suite is being made hermetic. Each fix can flip its tests
# from "red on Win/Mac" to "green on Win/Mac" incrementally. Once the
# remaining failures are cleaned up, drop `continue-on-error: true` and
# add `test-cross` to required checks to make cross-platform green a
# hard merge gate.
#
# main pushes skip test-cross to keep private-repo billing predictable
# (macos-latest is 10x and windows-latest is 2x the ubuntu rate).
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: test-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22' # engines: node >=22.12
cache: npm
- name: Install dependencies
run: npm ci
- name: Run tests (node --test)
run: npm test
test-cross:
# Advisory cross-platform run: PR-only (skips main push to save billing),
# continue-on-error so a known Win/Mac regression does not block merge
# while the suite is being hardened. Reviewers still see the result and
# can opt-in to wait for a fix on a per-PR basis.
if: github.event_name == 'pull_request'
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
- name: Install dependencies
run: npm ci
- name: Run tests (node --test)
run: npm test