name: Tests

on:
  - pull_request
  - push

env:
  CI: 1

jobs:
  main:
    defaults:
      run:
        shell: bash

    strategy:
      matrix:
        include:
          - os: ubuntu-latest
            node_version: 16
            experimental: false
          - os: ubuntu-latest
            node_version: 10
            experimental: false
          - os: macos-latest
            node_version: 16
            experimental: true
          - os: windows-latest
            node_version: 16
            experimental: true

    runs-on: ${{ matrix.os }}
    continue-on-error: ${{ matrix.experimental }}

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node_version }}

      - run: npm config set script-shell 'bash'
        if: runner.os == 'Windows'

      - run: npm install

      - run: |
          if [ "${{ matrix.node_version }}" -lt 10 ]; then
            npm run test
          elif [ "${RUNNER_OS}" = 'Linux' ]; then
            xvfb-run --auto-servernum npm run test:full
          else
            npm run test:full
          fi

name: Tests

on:
  - pull_request
  - push

env:
  CI: 1

jobs:
  main:
    defaults:
      run:
        shell: bash

    strategy:
      matrix:
        include:
          - os: ubuntu-latest
            node_version: 18
            experimental: false
          - os: ubuntu-latest
            node_version: 16
            experimental: false
          - os: ubuntu-latest
            node_version: 12
            experimental: true
          - os: macos-latest
            node_version: 16
            experimental: true
          - os: windows-latest
            node_version: 16
            experimental: true

    runs-on: ${{ matrix.os }}
    continue-on-error: ${{ matrix.experimental }}

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node_version }}

      - run: npm config set script-shell 'bash'
        if: runner.os == 'Windows'

      - run: npm install

      - run: |
          if [ "${{ matrix.node_version }}" -lt 10 ]; then
            npm run test
          elif [ "${RUNNER_OS}" = 'Linux' ]; then
            xvfb-run --auto-servernum npm run test:full
          else
            npm run test:full
          fi

Set minimum node version to 12
ci: Set minimum node version to 12
