#!/usr/bin/env bun // Everything CI runs, in order; stops at the first failure. bun run ci const steps: [string, string[]][] = [ ['adapters', ['bun', 'tools/gen-adapters.ts', '--check']], ['tests', ['bun', 'test']], ['typecheck', ['bunx', 'tsc', '--noEmit']], ['scrub', ['bun', 'tools/scrub.ts']], ]; const root = new URL('..', import.meta.url).pathname; for (const [name, cmd] of steps) { const t = Date.now(); console.log(`\n== ${name}: ${cmd.join(' ')}`); const r = Bun.spawnSync(cmd, { cwd: root, stdout: 'inherit', stderr: 'inherit' }); if (r.exitCode !== 0) { console.error(`\nci: ${name} failed (exit ${r.exitCode})`); process.exit(1); } console.log(`== ${name} ok (${((Date.now() - t) / 1000).toFixed(1)}s)`); } console.log('\nci: all green');