diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4f3758e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: PR Checks + +on: + pull_request: + branches: [ main ] + +jobs: + quality-checks: + runs-on: ubuntu-latest + + # Run all commands inside the frontend directory + defaults: + run: + working-directory: ./frontend + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup 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: Run ESLint + # Uses the "lint": "eslint" script from your package.json + run: npm run lint + + - name: Check TypeScript Types + # Uses npx to run the TypeScript compiler and check for errors without generating files + run: npx tsc --noEmit + + - name: Verify Next.js Build + # Uses the "build": "next build" script + # Next.js will also do a strict check here, but having them separate makes debugging easier! + run: npm run build \ No newline at end of file