feat: support versions object in yaml #26
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Node.js CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x, 16.x, 18.x, 20.x, 21.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
cache-dependency-path: 'package.json' | |
- run: npm install | |
- name: Lint code | |
run: npm run lint | |
- name: Downgrade tap to v16 | |
# Tap 18 doesn't support Node.js 14, so downgrade the previous major | |
if: matrix.node-version == '14.x' | |
run: npm install tap@16 | |
- name: Run tests | |
if: matrix.node-version != '20.x' | |
run: node test.js | |
- name: Run tests (+ generate code coverage report) | |
if: matrix.node-version == '20.x' | |
run: npm run ci:coverage | |
- name: Upload coverage to Codecov | |
if: matrix.node-version == '20.x' | |
uses: codecov/codecov-action@v4-beta | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./.tap/report |