name: Check Code Quality

on: [pull_request]

jobs:
  check-lint-and-build:
    runs-on: ubuntu-latest
    timeout-minutes: 10

    steps:
    - uses: actions/checkout@v2

    - name: Install Node
      uses: actions/setup-node@v1
      with:
        node-version: 20.x

    - name: Install packages
      run: npm install
    
    - name: Check linting
      run: npm run lint:check

    - name: Check build
      run: npm run db:generate

    - name: Check build
      run: npm run build