Compare commits

...

3 commits

Author SHA1 Message Date
56f1591b6e
Merge branch 'boot-test-workflow'
All checks were successful
Make sure the server is actually able to start / prettier (push) Successful in 19s
Run node --check on everything / node-check (push) Successful in 4s
Check project using prettier / prettier (push) Successful in 9s
This will hopefully make sure that the server actually starts before
giving that coveted "tests passed" status.
2024-05-24 18:07:01 +00:00
c05b6f1a8a
Fix a bug 2024-05-24 18:04:26 +00:00
527880457c
Add a test that makes sure that the server can start successfully 2024-05-24 18:01:01 +00:00
2 changed files with 22 additions and 1 deletions

View file

@ -0,0 +1,15 @@
name: "Make sure the server is actually able to start"
author: "9pfs@amcforum.wiki (h @ nest)"
on:
push:
branches:
- main
jobs:
prettier:
runs-on: docker
steps:
- uses: actions/checkout@v3
- id: dependencies
run: NODE_ENV=development npm ci
- id: boot-test
run: TEST_MODE=boot LISTEN_PATH=/tmp/webserver.sock node index.js

View file

@ -89,4 +89,10 @@ if (listen_path[0] == "/") {
await unlink(listen_path);
} catch (e) {}
}
app.listen(listen_path);
const listener = app.listen(listen_path);
if (process.env?.TEST_MODE == "boot") {
console.log("Server started successfully.");
// We've successfully started. Time to shut down.
listener.close();
process.exit(0);
}