Skip to content

Commit

Permalink
ci(test): use a single test job that we can require, independent of…
Browse files Browse the repository at this point in the history
… test matrix (#2581)
  • Loading branch information
gr2m committed Feb 3, 2024
1 parent 7468cf1 commit ad8c80e
Showing 1 changed file with 34 additions and 15 deletions.
49 changes: 34 additions & 15 deletions .github/workflows/continuous-integration.yaml
Expand Up @@ -63,9 +63,26 @@ jobs:
- name: Lint
run: |
npm run lint:ts
test:
name: Test
# verify against ranges defined as supported in engines.node
test_matrix:
strategy:
fail-fast: false
matrix:
node-version:
- 10
- 12
- 14
- 16
- 18
os:
- macos-latest
- ubuntu-latest
- windows-latest

runs-on: ${{ matrix.os }}
timeout-minutes: 5

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -83,16 +100,18 @@ jobs:
- name: Test jest
run: npm run test:jest
if: matrix.node-version >= 14
strategy:
fail-fast: false
matrix:
node-version:
- 10
- 12
- 14
- 16
- 18
os:
- macos-latest
- ubuntu-latest
- windows-latest

# separate job to set as required in branch protection,
# as the build names above change each time Node versions change
test:
runs-on: ubuntu-latest
needs:
- test_matrix
if: ${{ !cancelled() }}
steps:
- name: All matrix versions passed
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Some matrix version failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

0 comments on commit ad8c80e

Please sign in to comment.