39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
|
# 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, develop]
|
||
|
pull_request_review:
|
||
|
branches: [master, develop]
|
||
|
types: [submitted]
|
||
|
|
||
|
jobs:
|
||
|
ci_app:
|
||
|
if: ${{ (github.event_name == 'push') || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && (github.event.review.author_association == 'COLLABORATOR' || github.event.review.author_association == 'MEMBER' || github.event.review.author_association == 'OWNER') && !github.event.pull_request.draft && github.event.pull_request.state == 'open') }}
|
||
|
runs-on: ubuntu-latest
|
||
|
strategy:
|
||
|
matrix:
|
||
|
node-version: [14.x]
|
||
|
steps:
|
||
|
- uses: 'actions/checkout@v2'
|
||
|
|
||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||
|
uses: 'actions/setup-node@v2.1.4'
|
||
|
with:
|
||
|
node-version: ${{ matrix.node-version }}
|
||
|
|
||
|
- name: 'Cache dependencies'
|
||
|
uses: 'actions/cache@v2'
|
||
|
with:
|
||
|
path: |
|
||
|
**/node_modules
|
||
|
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
|
||
|
|
||
|
- name: 'Install dependencies'
|
||
|
run: 'npm install'
|
||
|
|
||
|
- name: 'Run the tests'
|
||
|
run: 'npm test'
|