Skip to content

Commit 3eea5fa

Browse files
committed
build: run server on background
1 parent 6bb5d16 commit 3eea5fa

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/workflows/build-branch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
node-version: 18
1818
- run: find . -name 'package-lock.json' -execdir npm ci \;
19-
- run: npm run dev:test
19+
- run: npm run dev:test &
2020
- run: npx wait-on tcp:9595
2121
- run: npm run test
2222
build-latest:

wait-and-run.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { spawn } from 'child_process';
2+
3+
console.log('hello');
4+
5+
const child = spawn('npm', ['run', 'vitest']);
6+
7+
child.stdout.on('data', (data) => {
8+
console.log(`stdout: ${data}`);
9+
});
10+
11+
child.stderr.on('data', (data) => {
12+
console.error(`stderr: ${data}`);
13+
});
14+
15+
child.on('error', (error) => {
16+
console.error('Failed to start subprocess.');
17+
});
18+
19+
child.on('close', (code) => {
20+
console.log(`child process exited with code ${code}`);
21+
});

0 commit comments

Comments
 (0)