name: CI
on:
  push:
    branches: [ master ]
  pull_request:

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  preflight:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      # Set node version
      - uses: actions/setup-node@v4
        with:
          node-version: '12.14.1'

      # Cache node_modules
      - uses: actions/cache@v4
        env:
          cache-name: cache-node-modules
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}

      - name: Install node modules
        run: npm install

      - name: Preflight
        run: npm run preflight
