name: 'Build and Lint on Pull Requests'
on:
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up node
        uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm

      - name: Install dependencies
        run: npm install
        
      - name: Build application
        run: npm run build

      - name: Check for ESLint warnings and errors
        run: npm run lint