Test server startup on GitHub workflow

This commit is contained in:
00Fjongl 2024-08-08 20:44:15 -05:00
parent 4119a28bb4
commit 2cad648413

View file

@ -59,14 +59,26 @@ commands: for (let i = 2; i < process.argv.length; i++)
fileURLToPath(new URL('./backend.js', import.meta.url)), fileURLToPath(new URL('./backend.js', import.meta.url)),
{ {
cwd: process.cwd(), cwd: process.cwd(),
stdio: ['inherit', 'inherit', 'pipe', 'ipc'], stdio: ['inherit', 'pipe', 'pipe', 'ipc'],
detached: true, detached: true
} }
); );
server.stderr.on('data', (stderr) => { server.stderr.on("data", stderr => {
console.error(stderr.toString()); console.error(stderr.toString());
if (stderr.toString().indexOf("DeprecationWarning") + 1)
return;
server.stderr.destroy();
process.exitCode = 1; process.exitCode = 1;
}); });
server.stdout.on("data", () => {
server.kill();
const server2 = fork(
fileURLToPath(new URL('./backend.js', import.meta.url)),
{cwd: process.cwd(), detached: true}
);
server2.unref();
server2.disconnect();
});
server.unref(); server.unref();
server.disconnect(); server.disconnect();
} }
@ -165,4 +177,4 @@ commands: for (let i = 2; i < process.argv.length; i++)
// No default case. // No default case.
} }
process.exitCode = process.exitCode || 0; process.exitCode = process.exitCode || 0;