Skip to content

Commit 3f3eaa4

Browse files
ci: pushes to next can no longer publish untested — release.yml was the only workflow triggering on next and ran zero tests before changeset publish; a test job (plugin build + the ssr, css-matrix, turnkey, start-client, and start-env suites) now gates the release job, the browser suites take the runner's preinstalled Chrome via CHROME_BIN (macOS app path stays the default), and the e2e/vitest workflows cover next alongside main
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent e180576 commit 3f3eaa4

7 files changed

Lines changed: 62 additions & 8 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: ci
33

44
on:
55
pull_request:
6-
branches: [main]
6+
branches: [main, next]
77
push:
8-
branches: [main]
8+
branches: [main, next]
99

1010
jobs:
1111
e2e-tests:

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,58 @@ permissions:
1414
id-token: write
1515

1616
jobs:
17+
# Publish gate: release.yml is the only workflow that runs on pushes to
18+
# next, so without this job a push publishes to npm with zero tests run.
19+
test:
20+
name: Test
21+
runs-on: ubuntu-latest
22+
env:
23+
# Preinstalled Chrome on GitHub's ubuntu images; the example suites
24+
# default to the macOS app path when unset.
25+
CHROME_BIN: /usr/bin/google-chrome
26+
steps:
27+
- name: Checkout Repo
28+
uses: actions/checkout@v3
29+
30+
- uses: pnpm/action-setup@v3
31+
with:
32+
# https://github.com/pnpm/pnpm/issues/8953
33+
version: 9.15.3
34+
35+
- name: Setup Node.js 24.x
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: 24.x
39+
40+
- name: Install Dependencies
41+
run: pnpm i --frozen-lockfile
42+
43+
- name: Build plugin
44+
run: pnpm run build
45+
46+
- name: SSR suite
47+
working-directory: examples/ssr
48+
run: pnpm run test
49+
50+
- name: CSS matrix suite
51+
working-directory: examples/css-matrix
52+
run: pnpm run test
53+
54+
- name: Turnkey suite
55+
working-directory: examples/turnkey
56+
run: pnpm run test
57+
58+
- name: Start client suite
59+
working-directory: examples/start-client
60+
run: pnpm run test
61+
62+
- name: Start env suite
63+
working-directory: examples/start-env
64+
run: pnpm run test
65+
1766
release:
1867
name: Release
68+
needs: test
1969
runs-on: ubuntu-latest
2070
steps:
2171
- name: Checkout Repo

.github/workflows/vitest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: ci
22

33
on:
44
pull_request:
5-
branches: [main]
5+
branches: [main, next]
66
push:
7-
branches: [main]
7+
branches: [main, next]
88

99
jobs:
1010
vitest:

examples/css-matrix/test/run.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import path from 'node:path';
1313
import { rmSync } from 'node:fs';
1414

1515
const exampleDir = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
16-
const CHROME = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
16+
const CHROME =
17+
process.env.CHROME_BIN || '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
1718
const CDP_PORT = 9334;
1819

1920
const COLORS = {

examples/start-client/test/run.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ import path from 'node:path';
3030
import { existsSync, readdirSync, readFileSync, rmSync } from 'node:fs';
3131

3232
const exampleDir = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
33-
const CHROME = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
33+
const CHROME =
34+
process.env.CHROME_BIN || '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
3435
const CDP_PORT = 9341;
3536
const DEV_PORT = 5191;
3637
const PREVIEW_PORT = 5192;

examples/start-env/test/run.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import path from 'node:path';
3535
import { existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
3636

3737
const exampleDir = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
38-
const CHROME = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
38+
const CHROME =
39+
process.env.CHROME_BIN || '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
3940
const CDP_PORT = 9351;
4041
const DEV_PORT = 5291;
4142
const PREVIEW_PORT = 5292;

examples/turnkey/test/run.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ const exampleDir = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
127127
// cwd stays wherever it was invoked from — regression coverage for the
128128
// plugin resolving relative filter globs against process.cwd() instead of
129129
// the Vite root (spawned modes pass explicit cwds either way).
130-
const CHROME = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
130+
const CHROME =
131+
process.env.CHROME_BIN || '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
131132
const CDP_PORT = 9337;
132133

133134
const SECRET = 'SERVER-ONLY-SECRET';

0 commit comments

Comments
 (0)