Skip to content

Commit f603b5b

Browse files
fix(e2e): use --outfile=path syntax for esbuild and split Windows build for E2E cache
- Fix esbuild arg: --outfile=path instead of --outfile path (separate args) - Split Windows out of build matrix into standalone build-windows job - E2E depends on build-windows only (doesn't wait for Linux/macOS) - E2E reuses Windows Rust cache for near-instant cargo build
1 parent abbfc58 commit f603b5b

2 files changed

Lines changed: 48 additions & 19 deletions

File tree

.github/workflows/pr.yml

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ permissions:
1010
env:
1111
CARGO_TERM_COLOR: always
1212

13-
# ── Shared setup anchors ─────────────────────────────────────────────
14-
# Reused across jobs via composite actions would be ideal, but YAML
15-
# anchors keep it DRY within a single file.
16-
1713
jobs:
1814
# ── Phase 1: Lint (fast, fail-fast) ────────────────────────────────
1915
lint:
@@ -48,7 +44,7 @@ jobs:
4844
cargo install --locked cargo-deny || true
4945
cargo deny check
5046
51-
# ── Phase 2: Test (parallel with build) ────────────────────────────
47+
# ── Phase 2: Test (Ubuntu) ─────────────────────────────────────────
5248
test:
5349
name: Test
5450
runs-on: ubuntu-latest
@@ -70,25 +66,21 @@ jobs:
7066
- name: Test
7167
run: cargo test --workspace
7268

73-
# ── Phase 2: Build (matrix: Linux, Windows, macOS) ──────────────────
69+
# ── Phase 2: Build (Linux + macOS matrix) ──────────────────────────
7470
build:
7571
name: Build (${{ matrix.os }})
7672
runs-on: ${{ matrix.os }}
7773
needs: lint
7874
strategy:
7975
matrix:
80-
os: [ubuntu-latest, windows-latest, macos-latest]
76+
os: [ubuntu-latest, macos-latest]
8177
steps:
8278
- uses: actions/checkout@v4
8379

8480
- name: Install protoc (Linux)
8581
if: runner.os == 'Linux'
8682
run: sudo apt-get update -qq && sudo apt-get install -y -qq protobuf-compiler
8783

88-
- name: Install protoc (Windows)
89-
if: runner.os == 'Windows'
90-
run: choco install protoc -y
91-
9284
- name: Install protoc (macOS)
9385
if: runner.os == 'macOS'
9486
run: brew install protobuf
@@ -123,9 +115,9 @@ jobs:
123115
- name: Build docs
124116
run: pnpm --filter @webui/docs build
125117

126-
# ── Phase 2: E2E (Windows only — screenshots match dev baselines) ──
127-
e2e:
128-
name: E2E Tests
118+
# ── Phase 2: Build Windows ─────────────────────────────────────────
119+
build-windows:
120+
name: Build (Windows)
129121
runs-on: windows-latest
130122
needs: lint
131123
steps:
@@ -158,16 +150,54 @@ jobs:
158150
- name: Build workspace
159151
run: cargo build --workspace --exclude xtask
160152

161-
- name: Build example client bundles
153+
- name: Build examples
162154
run: cargo xtask build-examples
163155

156+
- name: Build docs
157+
run: pnpm --filter @webui/docs build
158+
159+
# ── Phase 3: E2E (after Windows build — reuses Rust cache) ─────────
160+
e2e:
161+
name: E2E Tests
162+
runs-on: windows-latest
163+
needs: build-windows
164+
steps:
165+
- uses: actions/checkout@v4
166+
167+
- name: Install protoc
168+
run: choco install protoc -y
169+
170+
- name: Setup Rust
171+
uses: dtolnay/rust-toolchain@stable
172+
with:
173+
toolchain: 1.93
174+
175+
- name: Rust Cache
176+
uses: Swatinem/rust-cache@v2
177+
178+
- name: Setup Node.js
179+
uses: actions/setup-node@v4
180+
with:
181+
node-version: '22'
182+
183+
- name: Setup pnpm
184+
uses: pnpm/action-setup@v4
185+
with:
186+
run_install: false
187+
188+
- name: Install dependencies
189+
run: pnpm install
190+
191+
- name: Build workspace
192+
run: cargo build --workspace --exclude xtask
193+
164194
- name: Install Playwright browsers
165195
run: npx playwright install chromium
166196

167197
- name: Run E2E tests
168198
run: cargo xtask e2e
169199

170-
# ── Phase 2: WASM (parallel with test and build) ───────────────────
200+
# ── Phase 2: WASM (Ubuntu) ─────────────────────────────────────────
171201
wasm:
172202
name: WASM
173203
runs-on: ubuntu-latest

xtask/src/e2e.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,15 @@ pub fn run() -> ExitCode {
9696
continue;
9797
}
9898
let out = dir.join("dist").join("index.js");
99-
let out_str = out.to_string_lossy();
99+
let outfile_arg = format!("--outfile={}", out.to_string_lossy());
100100
let src_str = index_ts.to_string_lossy();
101101
match util::run_command_quiet(
102102
"npx",
103103
&[
104104
"esbuild",
105105
&src_str,
106106
"--bundle",
107-
"--outfile",
108-
&out_str,
107+
&outfile_arg,
109108
"--format=esm",
110109
"--sourcemap",
111110
],

0 commit comments

Comments
 (0)