2020-07-12 01:55:31 +08:00
|
|
|
name: Test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "*"
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: "12.x"
|
|
|
|
|
|
|
|
- name: Cache node modules
|
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
2020-09-25 00:08:14 +08:00
|
|
|
key:
|
|
|
|
${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
|
2020-07-12 01:55:31 +08:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-npm-cache-
|
|
|
|
|
|
|
|
- name: Install & Test
|
|
|
|
run: |
|
|
|
|
npm install
|
|
|
|
npm run test
|
2020-07-23 01:56:10 +08:00
|
|
|
|
|
|
|
- name: Code Coverage
|
|
|
|
uses: codecov/codecov-action@v1
|