fix ci
All checks were successful
Deploy to Pages / build (pull_request) Successful in 2m36s

This commit is contained in:
Andras Schmelczer 2026-05-24 11:40:26 +01:00
parent e9b6035c58
commit 2165ed0c33
3 changed files with 34 additions and 2 deletions

View file

@ -10,7 +10,7 @@ required client JavaScript.
```sh
npm install
npx playwright install chromium # required before `npm run qa:overflow`
npx playwright install --with-deps chromium # required before `npm run qa:overflow`
```
## Commands

View file

@ -12,7 +12,7 @@
"build": "astro build",
"preview": "astro preview",
"qa:no-js": "node scripts/check-no-js.mjs",
"qa:overflow": "node scripts/check-overflow.mjs",
"qa:overflow": "node scripts/install-playwright-deps.mjs && node scripts/check-overflow.mjs",
"qa": "npm run typecheck && npm run lint && npm run build && npm run qa:no-js && npm run qa:overflow"
},
"repository": {

View file

@ -0,0 +1,32 @@
import { spawnSync } from 'node:child_process';
import { existsSync } from 'node:fs';
import { chromium } from 'playwright';
const isLinux = process.platform === 'linux';
if (!isLinux) {
process.exit(0);
}
const executablePath = chromium.executablePath();
let needsInstall = !existsSync(executablePath);
if (!needsInstall) {
const ldd = spawnSync('ldd', [executablePath], { encoding: 'utf8' });
const output = `${ldd.stdout ?? ''}${ldd.stderr ?? ''}`;
needsInstall = ldd.status !== 0 || output.includes('not found');
}
if (!needsInstall) {
process.exit(0);
}
const result = spawnSync('playwright', ['install', '--with-deps', 'chromium'], {
stdio: 'inherit',
});
if (result.error) {
throw result.error;
}
process.exit(result.status ?? 1);