ci(web-e2e): prebuild server so Playwright webServer stops timing out #94
@@ -25,6 +25,19 @@ jobs:
|
|||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Cache cargo build
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
# Prebuild the server so Playwright's `webServer` (which runs
|
||||||
|
# `cargo run -p solitaire_server`) starts from a compiled binary instead
|
||||||
|
# of cold-compiling the whole dependency graph (axum/sqlx/reqwest) inside
|
||||||
|
# its 120s startup window — the timeout that was failing every run.
|
||||||
|
# SQLX_OFFLINE uses the checked-in `.sqlx/` query cache (no live DB).
|
||||||
|
- name: Prebuild server
|
||||||
|
env:
|
||||||
|
SQLX_OFFLINE: 'true'
|
||||||
|
run: cargo build -p solitaire_server --quiet
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -35,7 +35,11 @@ module.exports = defineConfig({
|
|||||||
`cargo run -p solitaire_server --quiet`,
|
`cargo run -p solitaire_server --quiet`,
|
||||||
cwd: repoRoot,
|
cwd: repoRoot,
|
||||||
url: `http://127.0.0.1:${serverPort}/health`,
|
url: `http://127.0.0.1:${serverPort}/health`,
|
||||||
timeout: 120_000,
|
// CI prebuilds the server (see web-e2e.yml) so `cargo run` reuses the
|
||||||
|
// compiled binary and starts in seconds. The generous timeout is a
|
||||||
|
// safety margin for a cold cargo cache (e.g. first run after a deps
|
||||||
|
// bump) where `cargo run` may still recompile.
|
||||||
|
timeout: 300_000,
|
||||||
reuseExistingServer: !process.env.CI,
|
reuseExistingServer: !process.env.CI,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user