name: CI

on:
  pull_request:
    branches:
    - '*'
  schedule:
    - cron: '10 5 * * 0'

jobs:
  eslint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Use Node.js latest
        uses: actions/setup-node@v2

      - name: npm install
        run: npm ci

      - name: eslint
        run: npm run lint

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v1
        with:
          languages: javascript

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v1


  test:
    name: Test NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        node-version: [12.x, 14.x]
        os: [ubuntu-latest, windows-latest, macos-latest]

    steps:
      - uses: actions/checkout@v2

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node-version }}

      - name: npm install and test
        run: npm cit
        env:
            CI: true

name: CI

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - '*'
  schedule:
    - cron: '10 5 * * 0'

jobs:
  eslint:
    name: Lint
    runs-on: ubuntu-latest
    permissions:
      security-events: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Use Node.js latest
        uses: actions/setup-node@v2
        with:
          cache: npm

      - name: npm install
        run: npm ci

      - name: eslint
        run: npm run lint

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v1
        with:
          languages: javascript

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v1


  test:
    name: Test NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        node-version: [12, 14, 16]
        os: [ubuntu-latest, windows-latest, macos-latest]

    steps:
      - uses: actions/checkout@v2

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node-version }}
          cache: npm

      - name: npm install and test
        run: npm cit
        env:
          CI: true

Update GitHub Actions workflow file
Update GitHub Actions workflow file
