Update build targets #27
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: Test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
name: Node.js | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
node: | |
- 20 | |
- 18 | |
- 16 | |
- 14 | |
steps: | |
# ----------------------------------------------------------------------- | |
- name: Clone default branch | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
# ----------------------------------------------------------------------- | |
- name: Set Node.js version | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
# ----------------------------------------------------------------------- | |
- name: Cache node_modules | |
id: cache-modules | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: ${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('package.json') }} | |
# ----------------------------------------------------------------------- | |
- name: Install deps | |
if: steps.cache-modules.outputs.cache-hit != 'true' | |
run: | | |
npm install | |
# ----------------------------------------------------------------------- | |
- name: Run Tests | |
run: | | |
npm test | |
# ----------------------------------------------------------------------- |