diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index a7c5e11..96e3a4b 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,6 +1,13 @@ -name: Node_CI +# 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 -on: [push] +name: Node.js CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] jobs: build: @@ -9,18 +16,15 @@ jobs: strategy: matrix: - node-version: [20.x] + node-version: [14.x, 16.x, 18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: npm install, build, and test - run: | - npm install - npm run build --if-present - npm test - env: - CI: true + cache: 'npm' + - run: npm install + - run: npm test