From f1181d15f482699ccb095ca85e8004e6fb14a76d Mon Sep 17 00:00:00 2001 From: Alimzy Date: Wed, 21 Oct 2026 10:14:39 +0100 Subject: [PATCH] ci: add typecheck, lint, and test jobs to CI workflow (#961) --- .github/workflows/ci.yml | 53 +++++++++++++++++++++-- package.json | 93 ++++++++++++++++++++-------------------- vite.config.ts | 1 - 3 files changed, 96 insertions(+), 51 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bd497c9..42f626e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,17 +1,62 @@ name: CI + on: push: - branches: [master] + branches: [ main, master ] pull_request: - branches: [master] + branches: [ main, master ] + jobs: + typecheck: + name: Typecheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - run: npm ci + - run: npm run typecheck + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - run: npm ci + - run: npm run lint + + test: + name: Test & Coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - run: npm ci + - run: npm run test + - name: Upload Coverage Artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: coverage-summary + path: coverage/ + build: + name: Build runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 22 - cache: npm + node-version: 20 + cache: 'npm' - run: npm ci - run: npm run build diff --git a/package.json b/package.json index 6434db3c..bd88366f 100644 --- a/package.json +++ b/package.json @@ -1,48 +1,49 @@ { - "name": "revora-frontend", - "version": "0.1.0", - "private": true, - "scripts": { - "dev": "vite", - "build": "vite build", - "preview": "vite preview", - "lint": "node ./node_modules/eslint/bin/eslint.js \"src/**/*.{ts,tsx}\"", - "test": "vitest run --coverage", - "test:watch": "vitest" - }, - "dependencies": { - "@hookform/resolvers": "^5.9.1", - "html2canvas": "^1.4.1", - "lucide-react": "^1.7.0", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-hook-form": "^7.86.0", - "react-router-dom": "^7.13.2", - "zod": "^3.25.76" - }, - "devDependencies": { - "@testing-library/jest-dom": "^6.9.1", - "@testing-library/react": "^16.3.2", - "@testing-library/user-event": "^14.6.1", - "@types/jest-axe": "^3.5.9", - "@types/react": "^18.3.11", - "@types/react-dom": "^18.3.0", - "@typescript-eslint/eslint-plugin": "^8.15.0", - "@typescript-eslint/parser": "^8.15.0", - "@vitejs/plugin-react-swc": "^3.7.1", - "@vitest/coverage-v8": "^4.1.10", - "autoprefixer": "^10.6.1", - "eslint": "^9.14.0", - "jest-axe": "^10.0.0", - "jsdom": "^25.0.0", - "postcss": "^8.5.30", - "tailwindcss": "^3.4.17", - "typescript": "^5.7.0", - "vite": "^6.0.7", - "vitest": "^4.1.10" - }, - "allowScripts": { - "@swc/core@1.15.33": true, - "esbuild@0.25.12": true - } + "name": "revora-frontend", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "node ./node_modules/eslint/bin/eslint.js \"src/**/*.{ts,tsx}\"", + "test": "vitest run --coverage", + "test:watch": "vitest", + "typecheck": "tsc --noEmit -p ." + }, + "dependencies": { + "@hookform/resolvers": "^5.9.1", + "html2canvas": "^1.4.1", + "lucide-react": "^1.7.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-hook-form": "^7.86.0", + "react-router-dom": "^7.13.2", + "zod": "^3.25.76" + }, + "devDependencies": { + "@testing-library/jest-dom": "^6.9.1", + "@testing-library/react": "^16.3.2", + "@testing-library/user-event": "^14.6.1", + "@types/jest-axe": "^3.5.9", + "@types/react": "^18.3.11", + "@types/react-dom": "^18.3.0", + "@typescript-eslint/eslint-plugin": "^8.15.0", + "@typescript-eslint/parser": "^8.15.0", + "@vitejs/plugin-react-swc": "^3.7.1", + "@vitest/coverage-v8": "^4.1.10", + "autoprefixer": "^10.6.1", + "eslint": "^9.14.0", + "jest-axe": "^10.0.0", + "jsdom": "^25.0.0", + "postcss": "^8.5.30", + "tailwindcss": "^3.4.17", + "typescript": "^5.7.0", + "vite": "^6.0.7", + "vitest": "^4.1.10" + }, + "allowScripts": { + "@swc/core@1.15.33": true, + "esbuild@0.25.12": true + } } diff --git a/vite.config.ts b/vite.config.ts index 07dedb59..6c8389a1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -19,7 +19,6 @@ export default defineConfig({ 'src/hooks/useUploadQueue.ts', 'src/components/UploadQueue/index.ts', 'src/components/UploadQueue/UploadQueue.tsx', - 'src/pages/DistributionDashboard.tsx', 'src/utils/financialTermsValidation.ts', 'src/hooks/useFinancialTermsForm.ts', 'src/components/FinancialTermsForm/FinancialTermsForm.tsx',