name: 'Tests: node.js `assert`'

on: [pull_request, push]

jobs:
  assert-required:
    name: 'assert: required'
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version:
          - "15"
          - "14"
          - "13"
          - "12"

    steps:
      - uses: actions/checkout@v2
      - uses: ljharb/actions/node/run@main
        name: 'npm install && npm run tests-only'
        env:
          ASSERT: true
        with:
          node-version: ${{ matrix.node-version }}
          command: 'tests-only'

  assert-optional:
    name: 'assert: optional'
    runs-on: ubuntu-latest
    continue-on-error: true

    strategy:
      matrix:
        node-version:
          - "11"
          - "10"
          - "9"
          - "8"

    steps:
      - uses: actions/checkout@v2
      - uses: ljharb/actions/node/run@main
        name: 'npm install && npm run tests-only'
        env:
          ASSERT: true
        with:
          node-version: ${{ matrix.node-version }}
          command: 'tests-only'

  assert:
    name: 'node: assert'
    needs: [assert-required, assert-optional]
    runs-on: ubuntu-latest
    steps:
      - run: 'echo tests completed'
