2020-12-27 17:40:00 +01:00
|
|
|
# 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') }}
|
2021-02-14 19:28:15 +01:00
|
|
|
runs-on: 'ubuntu-latest'
|
2020-12-27 17:40:00 +01:00
|
|
|
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'
|
2021-02-08 14:57:20 +01:00
|
|
|
uses: 'actions/cache@v2.1.4'
|
2020-12-27 17:40:00 +01:00
|
|
|
with:
|
2021-02-14 19:28:15 +01:00
|
|
|
path: '**/node_modules'
|
2020-12-27 17:40:00 +01:00
|
|
|
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
|
|
|
|
|
|
|
|
- name: 'Install dependencies'
|
|
|
|
run: 'npm install'
|
|
|
|
|
2020-12-28 23:51:29 +01:00
|
|
|
- name: 'Lint'
|
|
|
|
run: 'npm run lint'
|
|
|
|
|
2021-02-14 19:28:15 +01:00
|
|
|
- name: 'MarkdownLint'
|
|
|
|
run: 'npm run markdownlint'
|
|
|
|
|
2020-12-28 23:51:29 +01:00
|
|
|
- name: 'Build'
|
|
|
|
run: 'npm run build'
|
|
|
|
|
2020-12-29 04:44:15 +01:00
|
|
|
- name: 'Run the tests and generate coverage report'
|
2020-12-27 17:40:00 +01:00
|
|
|
run: 'npm test'
|
2020-12-29 04:44:15 +01:00
|
|
|
|
|
|
|
- name: 'Upload coverage to Codecov'
|
|
|
|
uses: 'codecov/codecov-action@v1'
|