name: test
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version:
          - 12.x
          - 14.x
          - 16.x
        react-version:
          - ^16.8.0
          - ^17.0.0

    steps:
      - uses: actions/checkout@v2

      - uses: browser-actions/setup-firefox@latest

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

      - name: Install dependencies
        run: npm ci

      - name: Install react
        run: npm install --no-save react@${{ matrix.react-version }} react-dom@${{ matrix.react-version }}

      - name: Lint
        run: npm run lint

      - name: Test
        uses: nick-invision/retry@v1 # tests are somewhat flakey
        env:
          COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COVERALLS_SERVICE_NAME: "github"
          COVERALLS_GIT_COMMIT: ${{ github.sha }}
          COVERALLS_GIT_BRANCH: ${{ github.ref }}
          COVERALLS_SERVICE_JOB_ID: ${{ github.job }}
        with:
          timeout_minutes: 1 # Tests run for about 45s
          max_attempts: 3
          command: npm test

name: test
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version:
          - 12.x
          - 14.x
          - 16.x
        react-version:
          - ^16.8.0
          - ^17.0.0

    steps:
      - uses: actions/checkout@v2

      - uses: browser-actions/setup-firefox@latest

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

      - name: Install dependencies
        run: npm ci

      - name: Install react
        run: npm install --no-save react@${{ matrix.react-version }} react-dom@${{ matrix.react-version }}

      - name: Lint
        run: npm run lint

      - name: Test
        uses: nick-invision/retry@v1 # tests are somewhat flakey
        env:
          COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COVERALLS_SERVICE_NAME: "github"
          COVERALLS_GIT_COMMIT: ${{ github.sha }}
          COVERALLS_GIT_BRANCH: ${{ github.ref }}
          COVERALLS_SERVICE_JOB_ID: ${{ github.run_id }}
        with:
          timeout_minutes: 1 # Tests run for about 45s
          max_attempts: 3
          command: npm test

Use github run_id as coveralls job id
Use github run_id as coveralls job id
