name: dev
on: [push, pull_request]

jobs:
  test:
    name: Tests for Node ${{ matrix.node }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}

    strategy:
      fail-fast: false
      matrix:
        node: [0.10.x, 0.12.x, 4.x, 5.x, 6.x, 7.x, 8.x, 10.x, 12.x, 14.x, 16.x]
        os: [ubuntu-latest, windows-latest, macos-latest]

    steps:
      - name: Clone repository
        uses: actions/checkout@v2

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

      - run: node --version
      - run: npm --version

      - name: Install npm dependencies
        run: npm install

      - name: Run tests
        run: npm test
