diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..7866eaed --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,104 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + # ─── Listener (Node.js + TypeScript + Jest) ─────────────────────────────── + listener: + name: Listener — typecheck, lint, test + runs-on: ubuntu-latest + defaults: + run: + working-directory: listener + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: listener/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Typecheck + run: npm run typecheck + + - name: Lint + run: npm run lint + + - name: Format check + run: npm run format:check + + - name: Test + run: npm test -- --ci --runInBand + + # ─── Dashboard (React + Vite + Jest) ────────────────────────────────────── + dashboard: + name: Dashboard — typecheck, lint, test, build + runs-on: ubuntu-latest + defaults: + run: + working-directory: dashboard + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + cache-dependency-path: dashboard/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Format check + run: npm run format:check + + - name: Test + run: npm test -- --ci + + - name: Build + run: npm run build + + # ─── Frontend (React + Vite + Vitest) ───────────────────────────────────── + frontend: + name: Frontend — typecheck, lint, test, build + runs-on: ubuntu-latest + defaults: + run: + working-directory: frontend + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: frontend/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Test + run: npm test + + - name: Build + run: npm run build