From 5e787d045eae7a33e95f36dadddc89e27c577f99 Mon Sep 17 00:00:00 2001 From: Rayhab2000 Date: Mon, 28 Sep 2026 23:38:09 +0100 Subject: [PATCH] ci: add GitHub Actions workflow for listener, dashboard, and frontend - Listener: typecheck, lint, format check, Jest tests (Node 20) - Dashboard: lint, format check, Jest tests, Vite build (Node 22) - Frontend: lint, Vitest tests, Vite build (Node 20) Runs on push and pull_request targeting main. --- .github/workflows/ci.yml | 104 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 .github/workflows/ci.yml 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