From dd9bce4f30739752e00051e8c5894174cdfdaf74 Mon Sep 17 00:00:00 2001 From: Guido X Jansen Date: Wed, 4 Mar 2026 12:26:08 +0100 Subject: [PATCH] ci(web): add job timeouts and fix vitest worker count in CI (#150) Add timeout-minutes to all 6 CI jobs: lint/typecheck/security: 10 min, test: 15 min, build: 20 min, accessibility: 30 min. Fix vitest maxWorkers to use 2 workers in CI instead of 1. The previous Math.floor(cpuCount / 2) yields 1 on 2-CPU GitHub runners, causing all 925 tests to run serially. --- .github/workflows/ci.yml | 6 ++++++ vitest.config.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c77c8d0..13250f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: lint: name: Lint runs-on: ubuntu-latest + timeout-minutes: 10 steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -49,6 +50,7 @@ jobs: typecheck: name: Type Check runs-on: ubuntu-latest + timeout-minutes: 10 steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -78,6 +80,7 @@ jobs: test: name: Test runs-on: ubuntu-latest + timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -107,6 +110,7 @@ jobs: build: name: Build runs-on: ubuntu-latest + timeout-minutes: 20 needs: [lint, typecheck, test] steps: - name: Checkout @@ -146,6 +150,7 @@ jobs: accessibility: name: Accessibility Audit runs-on: ubuntu-latest + timeout-minutes: 30 needs: build steps: - name: Checkout @@ -224,6 +229,7 @@ jobs: security: name: Security Scan runs-on: ubuntu-latest + timeout-minutes: 10 steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/vitest.config.ts b/vitest.config.ts index a2a102f..9937681 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -13,7 +13,7 @@ export default defineConfig({ setupFiles: ['./src/test/setup.ts'], include: ['src/**/*.{test,spec}.{ts,tsx}'], testTimeout: 10_000, - maxWorkers: Math.max(1, Math.floor(cpuCount / 2)), + maxWorkers: process.env.CI ? 2 : Math.max(1, Math.floor(cpuCount / 2)), coverage: { provider: 'v8', reporter: ['text', 'json', 'html'], -- 2.51.2