Files
starter-workflows/ci/node.js.yml
T

32 lines
882 B
YAML
Raw Normal View History

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