name: Node CI

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        include:
          - mocha-version: 2
            node-version: 10.x
          - mocha-version: 3
            node-version: 10.x
          - mocha-version: 4
            node-version: 10.x
          - mocha-version: 5
            node-version: 10.x
          - mocha-version: 6
            node-version: 10.x
          - mocha-version: 7
            node-version: 12.x
          - mocha-version: 8
            node-version: 14.x
          - mocha-version: 9
            node-version: 14.x

    steps:
    - uses: actions/checkout@v1
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: npm install
      run: npm install
    - name: npm ci
      run: npm run ci
      env:
        CI: true
        MOCHA_VERSION: ${{ matrix.mocha-version }}
