@@ -12,6 +12,8 @@ permissions:
1212 contents : read
1313
1414jobs :
15+ # Fast feedback: lint, jsdom, chromium-only browser test across Node versions.
16+ # Runs on every push and every PR.
1517 install :
1618 runs-on : ubuntu-latest
1719
2123
2224 steps :
2325 - name : Harden the runner (Audit all outbound calls)
24- uses : step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17 .0
26+ uses : step-security/harden-runner@6c3c2f2c1c457b00c10c4848d6f5491db3b629df # v2.18 .0
2527 with :
2628 egress-policy : audit
2729
@@ -37,19 +39,81 @@ jobs:
3739 - name : Install Dependencies
3840 run : npm ci
3941
42+ - name : Install Playwright Browsers
43+ run : ./node_modules/.bin/playwright install --with-deps chromium firefox webkit
44+
4045 - name : Build
4146 run : npm run build
4247
4348 - name : Lint
4449 run : npm run lint
4550
4651 - name : Test
47- run : xvfb-run -a npm run test:ci
48- env :
49- TEST_BROWSERSTACK : ${{ startsWith(matrix.node-version, '25') }}
50- TEST_PROBE_ONLY : ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/2.x' }}
51- BS_USERNAME : ${{ secrets.BS_USERNAME }}
52- BS_ACCESSKEY : ${{ secrets.BS_ACCESSKEY }}
52+ run : npm run test:ci
53+
54+ - name : Upload Playwright report
55+ if : failure()
56+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
57+ with :
58+ name : playwright-report-node-${{ matrix.node-version }}
59+ path : playwright-report/
60+ retention-days : 7
5361
5462 - name : Verify TypeScript
5563 run : npm run verify-typescript
64+
65+ # Browser diversity: chromium + firefox + webkit across Ubuntu, macOS, and
66+ # Windows. Catches OS-specific rendering quirks (e.g. macOS WebKit ≈ real
67+ # Safari engine, Windows font shaping, Linux-specific parser paths).
68+ #
69+ # Only runs on release branches (main, 2.x, 3.x) to conserve runner minutes.
70+ # PRs get chromium-only coverage from the "install" job above, which is
71+ # sufficient for catching regressions.
72+ browser-matrix :
73+ if : github.event_name == 'push'
74+ runs-on : ${{ matrix.os }}
75+
76+ strategy :
77+ fail-fast : false
78+ matrix :
79+ os : [ubuntu-latest, macos-latest, windows-latest]
80+
81+ steps :
82+ - name : Harden the runner (Audit all outbound calls)
83+ uses : step-security/harden-runner@6c3c2f2c1c457b00c10c4848d6f5491db3b629df # v2.18.0
84+ with :
85+ egress-policy : audit
86+
87+ - name : Checkout
88+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
89+
90+ - name : Setup Node.js 25.x
91+ uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
92+ with :
93+ node-version : 25.x
94+ cache : npm
95+
96+ - name : Install Dependencies
97+ run : npm ci
98+
99+ - name : Install Playwright Browsers (Linux)
100+ if : runner.os == 'Linux'
101+ run : ./node_modules/.bin/playwright install --with-deps chromium firefox webkit
102+
103+ - name : Install Playwright Browsers (macOS / Windows)
104+ if : runner.os != 'Linux'
105+ run : ./node_modules/.bin/playwright install chromium firefox webkit
106+
107+ - name : Build
108+ run : npm run build
109+
110+ - name : Run browser tests (all engines)
111+ run : npm run test:browser
112+
113+ - name : Upload Playwright report
114+ if : failure()
115+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
116+ with :
117+ name : playwright-report-${{ matrix.os }}
118+ path : playwright-report/
119+ retention-days : 7
0 commit comments