add woodpecker pipelines

This commit is contained in:
2026-08-01 21:47:06 -04:00
parent 61ea97265c
commit 0362b3942d
6 changed files with 36 additions and 19 deletions
+16
View File
@@ -0,0 +1,16 @@
when:
event: [push, pull_request]
steps:
e2e-build:
image: rust:1
commands:
- cargo build
e2e-test:
image: node:24
commands:
- apt-get update
- apt-get install -y --no-install-recommends ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libcups2 libdbus-1-3 libdrm2 libgbm1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 xdg-utils
- cd e2e && npm install && npx playwright install chromium
- cd e2e && npx playwright test
+8
View File
@@ -0,0 +1,8 @@
when:
event: [push, pull_request]
steps:
fmt:
image: rust:1
commands:
- cargo fmt --all -- --check
+8
View File
@@ -0,0 +1,8 @@
when:
event: [push, pull_request]
steps:
test:
image: rust:1
commands:
- cargo test --all
+4 -5
View File
@@ -69,17 +69,16 @@ The e2e tests live in `e2e/` and use Playwright with a real browser. Each test
starts its own server against a fresh, throwaway database on a unique port, so
tests are fully isolated from each other and from your real `sustenance.db`.
The tests launch `target/debug/sustenance`, so build the server first:
```sh
# one-time setup
cargo build
cd e2e
npm install
npx playwright install chromium
# run the tests (builds the server automatically via globalSetup)
# run the tests (each test launches its own server against a fresh DB)
cd e2e
npx playwright test
```
The Playwright `globalSetup` runs `cargo build` before the suite, and each test
launches its own server against a fresh database, so no manual build or server
start is required.
-13
View File
@@ -1,13 +0,0 @@
import { execSync } from "child_process";
import * as path from "path";
/**
* Builds the Rust server before the test suite runs, so the fixture can launch
* `target/debug/sustenance` without requiring a manual `cargo build`.
*/
export default function globalSetup() {
execSync("cargo build", {
cwd: path.resolve(__dirname, ".."),
stdio: "inherit",
});
}
-1
View File
@@ -4,7 +4,6 @@ export default defineConfig({
testDir: "./tests",
timeout: 30_000,
retries: 0,
globalSetup: "./global-setup.ts",
use: {
trace: "on-first-retry",
},