Create a test Github Action (#640)

* Create test Action

* Add working directory to test Action

* Add npm caching to test Action
This commit is contained in:
Maciej Ziarkowski 2020-12-03 15:10:12 +00:00 committed by GitHub
parent 488a5da1bb
commit e789424ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

36
.github/workflows/node.js.yml vendored Normal file
View File

@ -0,0 +1,36 @@
# 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: [12.x]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
working-directory: ./app
- run: npm test
working-directory: ./app