Skip to content

Commit

Permalink
Create node.js.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah committed Feb 12, 2021
1 parent 51e71fb commit b30a9cd
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/node.js.yml
@@ -0,0 +1,41 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:

# cache node_modules
- name: Cache dependencies
uses: actions/cache@v2
id: npm-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
# install dependencies if the cache did not hit
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci

- name: Test
run: npm test

0 comments on commit b30a9cd

Please sign in to comment.