[CJS-8078] update example workflow #13
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 install of node dependencies and run tests on the version of Node specified | |
# in the .nvmrc file. | |
# Reference: https://docs.github.com/en/actions/language-and-framework-guides/github-actions-for-javascript-and-typescript | |
name: Run Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v2 | |
- name: Read .nvmrc | |
run: echo ::set-output name=NVMRC::$(cat .nvmrc) | |
id: nvm | |
- name: Setup Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '${{ steps.nvm.outputs.NVMRC }}' | |
- run: npm ci | |
- run: npm test |