Skip to content

Commit 1e5125a

Browse files
committed
ci: implement Promise.all semantics for parallel typecheck and web build with fail-fast behavior
Replace shell-based parallel execution with bun runtime Promise.all implementation: - Use child_process.spawn wrapped in Promises for better error handling - Implement fail-fast behavior where any command failure immediately exits - Maintain parallel execution of typecheck and web build commands - Add clear success/failure messaging with emoji indicators - Leverage bun's JavaScript runtime for more robust process orchestration This improves CI reliability by ensuring proper error propagation and cleaner failure modes compared to the previous shell-based approach. Codebuff
1 parent a34bfdc commit 1e5125a

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,21 @@ jobs:
5353
5454
- name: Typecheck and Build web in parallel
5555
run: |
56-
set -e
57-
bun run typecheck &
58-
PID1=$!
59-
cd web && bun run build &
60-
PID2=$!
61-
wait $PID1 && wait $PID2
56+
bun -e "
57+
const { spawn } = require('child_process');
58+
function runCommand(command, args, options = {}) {
59+
return new Promise((resolve, reject) => {
60+
const child = spawn(command, args, { stdio: 'inherit', ...options });
61+
child.on('close', (code) => code === 0 ? resolve() : reject(new Error('Command failed with exit code ' + code)));
62+
child.on('error', reject);
63+
});
64+
}
65+
Promise.all([
66+
runCommand('bun', ['run', 'typecheck']),
67+
runCommand('bun', ['run', 'build'], { cwd: 'web' })
68+
]).then(() => console.log('✅ Both typecheck and web build completed successfully!'))
69+
.catch(error => { console.error('❌ One or more commands failed:', error.message); process.exit(1); });
70+
"
6271
6372
# - name: Build npm-app
6473
# run: cd npm-app && bun run build

0 commit comments

Comments
 (0)