2022-01-27 04:59:07 +00:00
# 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
2022-10-20 04:29:35 +00:00
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
2022-01-27 04:59:07 +00:00
name : Node.js CI
on :
push :
branches : [ $default-branch ]
pull_request :
branches : [ $default-branch ]
jobs :
build :
runs-on : ubuntu-latest
strategy :
matrix :
2022-09-14 06:43:11 +00:00
node-version : [ 14. x, 16.x, 18.x]
2022-01-27 04:59:07 +00:00
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps :
2022-03-28 17:11:12 +00:00
- uses : actions/checkout@v3
2022-01-27 04:59:07 +00:00
- name : Use Node.js ${{ matrix.node-version }}
2022-03-28 17:11:12 +00:00
uses : actions/setup-node@v3
2022-01-27 04:59:07 +00:00
with :
node-version : ${{ matrix.node-version }}
cache : 'npm'
- run : npm ci
- run : npm run build --if-present
- run : npm test