2019-09-15 23:27:57 +00:00
|
|
|
name: 'Test'
|
|
|
|
|
2019-09-22 00:37:17 +00:00
|
|
|
on:
|
|
|
|
push:
|
2019-10-01 11:10:45 +00:00
|
|
|
branches:
|
2020-01-17 15:44:07 +00:00
|
|
|
- master
|
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2019-09-15 23:27:57 +00:00
|
|
|
|
|
|
|
jobs:
|
2020-01-17 15:44:07 +00:00
|
|
|
skipci:
|
2019-09-15 23:27:57 +00:00
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
2020-04-18 02:27:17 +00:00
|
|
|
- run: echo "[skip ci] ${{ contains(github.event.head_commit.message, '[skip ci]') }}"
|
2019-10-08 15:20:05 +00:00
|
|
|
|
2020-01-17 15:44:07 +00:00
|
|
|
test:
|
2019-09-21 01:41:21 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2020-01-17 15:44:07 +00:00
|
|
|
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
2019-09-15 23:27:57 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-01-17 15:44:07 +00:00
|
|
|
os:
|
2020-06-13 08:53:43 +00:00
|
|
|
- 'ubuntu-20.04'
|
2020-01-17 15:44:07 +00:00
|
|
|
- 'ubuntu-18.04'
|
2020-05-03 04:33:05 +00:00
|
|
|
- 'ubuntu-16.04'
|
2020-01-17 15:44:07 +00:00
|
|
|
- 'macos-latest'
|
|
|
|
- 'windows-latest'
|
2019-09-15 23:27:57 +00:00
|
|
|
steps:
|
2020-01-17 15:44:07 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Read .nvmrc
|
|
|
|
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
|
|
|
|
id: nvm
|
|
|
|
|
|
|
|
- name: Setup Node
|
2020-06-18 15:40:09 +00:00
|
|
|
uses: actions/setup-node@v2.0.0
|
2020-01-17 15:44:07 +00:00
|
|
|
with:
|
|
|
|
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
|
|
|
|
2020-04-18 02:30:41 +00:00
|
|
|
- run: npm i -g npm
|
2020-01-17 15:44:07 +00:00
|
|
|
- run: npm ci
|
|
|
|
|
|
|
|
- name: Run prettier
|
2020-05-03 04:33:05 +00:00
|
|
|
if: startsWith(matrix.os, 'ubuntu-18.04')
|
2020-01-17 15:44:07 +00:00
|
|
|
run: npm run format:check
|
|
|
|
|
|
|
|
- name: Run eslint
|
2020-05-03 04:33:05 +00:00
|
|
|
if: startsWith(matrix.os, 'ubuntu-18.04')
|
2020-01-17 15:44:07 +00:00
|
|
|
run: npm run lint
|
|
|
|
|
|
|
|
- name: Run ncc
|
2020-05-03 04:33:05 +00:00
|
|
|
if: startsWith(matrix.os, 'ubuntu-18.04')
|
2020-01-17 15:44:07 +00:00
|
|
|
run: npm run build
|
|
|
|
|
|
|
|
- run: npm test
|
|
|
|
|
|
|
|
- name: Upload test coverage as artifact
|
2020-05-03 04:33:05 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
2020-01-17 15:44:07 +00:00
|
|
|
with:
|
2020-05-03 04:33:05 +00:00
|
|
|
name: coverage-${{ matrix.os }}
|
2020-01-17 15:44:07 +00:00
|
|
|
path: coverage
|
|
|
|
|
2020-06-18 15:20:23 +00:00
|
|
|
- uses: codecov/codecov-action@v1.0.7
|
2020-01-17 17:48:31 +00:00
|
|
|
with:
|
2020-01-20 16:04:46 +00:00
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|