GitHub Actions: Test on modern versions of Node.js #95
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
jobs: | |
# Test once on every (available) plat, using LTS node version | |
# (https://nodejs.org/en/about/releases/). | |
test-plats: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22.x' | |
- run: npm ci | |
- run: npm test | |
# Test once for every supported node version (don't repeat the LTS | |
# node version from the previous step). Only test on one | |
# platform to not overkill the number of builds. | |
test-vers: | |
strategy: | |
matrix: | |
node: ['18.x', '20.x', '22.x'] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- run: npm ci | |
- run: npm test | |
# Test older versions separately because really old node/npm don't support | |
# 'npm ci'. | |
test-old-vers: | |
strategy: | |
matrix: | |
node: ['0.10.x', '4.x', '6.x', '8.x', '12.x', '16.x'] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- run: npm install | |
- run: npm test |