name: Node.js CI

on: [ push, pull_request ]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        node-version: [10.x, 12.x, 13.x, 14.x, 15.x]

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2.1.5
      with:
        node-version: ${{ matrix.node-version }}
    - run: node --version
    - run: npm --version
    - run: npm install --ignore-scripts
    - run: npm test
      env:
        CI: true

  test-legacy:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        node-version: [11.x, 13.x]

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2.1.5
      with:
        node-version: ${{ matrix.node-version }}
    - run: node --version
    - run: npm --version
    - run: npm install --ignore-scripts
    - run: npm run test-only
      env:
        CI: true
