name: CI
on:
  # Triggers the workflow on push or pull request events but only for the master branch
  push:
    branches: [master]
  pull_request:
    branches: [master]
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:
jobs:
  integrity:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.head_ref }}
      - name: Install modules
        run: npm install --save --legacy-peer-deps
      - name: Lint
        run: npm run lint
      - name: Format
        run: npm run format:check
      - name: Check Valid Scripts
        run: npm run check:valid
      - name: Check Invalid Scripts
        run: npm run check:invalid
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.head_ref }}
      - name: Install modules
        run: npm install --save --legacy-peer-deps
      - name: Build
        run: npm run build
