2020-09-10 19:08:29 +00:00
|
|
|
name: test
|
|
|
|
|
2020-10-01 01:18:23 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
2020-09-10 19:08:29 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2020-10-24 03:13:08 +00:00
|
|
|
node-version: [12, 14, 15]
|
2020-09-10 19:08:29 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2020-11-05 07:34:32 +00:00
|
|
|
uses: actions/checkout@v2.3.4
|
2020-09-10 19:08:29 +00:00
|
|
|
|
2020-09-10 20:26:14 +00:00
|
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
2020-12-17 06:28:55 +00:00
|
|
|
uses: actions/setup-node@v2.1.4
|
2020-09-10 19:08:29 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
|
2020-09-10 20:26:14 +00:00
|
|
|
- name: Cache Node.js modules
|
2020-09-10 21:52:56 +00:00
|
|
|
id: cache
|
2020-11-09 07:22:40 +00:00
|
|
|
uses: actions/cache@v2.1.3
|
2020-09-10 20:26:14 +00:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-
|
|
|
|
|
2020-09-10 21:52:56 +00:00
|
|
|
- name: Cache hit
|
|
|
|
run: echo ${{ steps.cache.outputs.cache-hit }}
|
|
|
|
|
2020-09-10 20:26:14 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: npm ci
|
2020-09-10 19:08:29 +00:00
|
|
|
env:
|
|
|
|
SKIP_BUILD: true
|
|
|
|
|
|
|
|
- name: Lint
|
|
|
|
run: npm run lint -- --no-fix
|
|
|
|
|
|
|
|
- name: Build
|
2020-09-28 22:30:03 +00:00
|
|
|
run: npm run build
|