diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cc9e45a..62df9dee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,3 +31,63 @@ jobs: - name: Test run: bun test + + smoke-test: + name: Smoke Test (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.3.9 + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Build CLI + run: bun run build:cli + working-directory: ./packages/chronicle + + - name: Build example + run: ./packages/chronicle/bin/chronicle.js build --config examples/basic/chronicle.yaml + shell: bash + + - name: Smoke test dev server + shell: bash + run: | + ./packages/chronicle/bin/chronicle.js dev --config examples/basic/chronicle.yaml --port 3001 & + DEV_PID=$! + for i in $(seq 1 30); do + if curl -sf http://localhost:3001/api/health > /dev/null 2>&1; then + echo "Dev server ready" + break + fi + sleep 2 + done + curl -sf http://localhost:3001/api/health | grep -q '"ok"' + echo "Dev server health check passed" + kill $DEV_PID 2>/dev/null || true + + - name: Smoke test start server + shell: bash + run: | + ./packages/chronicle/bin/chronicle.js start --config examples/basic/chronicle.yaml --port 3002 & + START_PID=$! + for i in $(seq 1 30); do + if curl -sf http://localhost:3002/api/health > /dev/null 2>&1; then + echo "Start server ready" + break + fi + sleep 2 + done + curl -sf http://localhost:3002/api/health | grep -q '"ok"' + echo "Start server health check passed" + kill $START_PID 2>/dev/null || true diff --git a/packages/chronicle/src/cli/commands/dev.ts b/packages/chronicle/src/cli/commands/dev.ts index 2dc4b2c4..f8cc703b 100644 --- a/packages/chronicle/src/cli/commands/dev.ts +++ b/packages/chronicle/src/cli/commands/dev.ts @@ -16,6 +16,11 @@ export const devCommand = new Command('dev') await linkContent(projectRoot, config); + // Nitro 3's default node-worker runner fails on Windows due to Vite 8 environment API incompatibility + if (process.platform === 'win32' && !process.env.NITRO_DEV_RUNNER) { + process.env.NITRO_DEV_RUNNER = 'node-process'; + } + console.log(chalk.cyan('Starting dev server...')); const { createServer } = await import('vite');