Upgrade to Node 20.12.2 #3
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: CI | |
on: [ push, pull_request ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
nvmrc: ${{ steps.makeNodeVersionOutput.outputs.nvmrc }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Put NVM version in output | |
id: makeNodeVersionOutput | |
run: echo "nvmrc=$(cat .nvmrc)" >> "$GITHUB_OUTPUT" | |
- run: npm ci | |
- name: Check for uncommitted changes # Done after dependency install and build to ensure code isn't compromised | |
run: if [ -n "$(git status --porcelain)" ]; then echo 'There are uncommitted changes.'; exit 1; fi | |
- run: npm run check-node-version | |
- run: npm run standards | |
test: | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [ 16, '${{ needs.build.outputs.nvmrc }}', 'lts/*', 'latest' ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm ci # Reinstall the dependencies to ensure they install with the current version of node | |
- run: npm run standards | |
- run: npm test | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 |