2019-09-15 23:27:57 +00:00
|
|
|
name: 'Test'
|
|
|
|
|
2019-09-22 00:37:17 +00:00
|
|
|
on:
|
2019-09-23 01:58:19 +00:00
|
|
|
pull_request:
|
2019-09-23 02:33:57 +00:00
|
|
|
types: [opened, synchronize]
|
2019-09-22 00:37:17 +00:00
|
|
|
push:
|
2019-10-01 11:10:45 +00:00
|
|
|
branches:
|
|
|
|
- master
|
2019-09-15 23:27:57 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2019-09-21 01:41:21 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2019-09-15 23:27:57 +00:00
|
|
|
|
2019-10-08 15:20:05 +00:00
|
|
|
- name: Read .nvmrc
|
|
|
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
|
|
|
id: nvm
|
|
|
|
|
|
|
|
- name: Setup node
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
|
|
|
|
2019-09-15 23:27:57 +00:00
|
|
|
- name: Install dependencies
|
2019-10-08 15:20:05 +00:00
|
|
|
run: npm install
|
2019-09-15 23:27:57 +00:00
|
|
|
|
2019-09-21 01:41:21 +00:00
|
|
|
- name: Format check
|
|
|
|
run: npm run format:check
|
|
|
|
|
2019-09-15 23:27:57 +00:00
|
|
|
- name: Lint
|
|
|
|
run: npm run lint
|
|
|
|
|
2019-09-21 01:41:21 +00:00
|
|
|
- name: Test
|
|
|
|
run: npm test
|
|
|
|
|
2019-10-08 15:20:05 +00:00
|
|
|
- name: Upload test coverage
|
|
|
|
uses: actions/upload-artifact@master
|
2019-09-21 01:41:21 +00:00
|
|
|
with:
|
|
|
|
name: coverage
|
|
|
|
path: coverage
|
2019-09-15 23:27:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
test-prod:
|
2019-09-21 01:41:21 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2019-09-17 19:11:47 +00:00
|
|
|
needs: test
|
2019-09-15 23:27:57 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2019-09-21 01:41:21 +00:00
|
|
|
os: ['ubuntu-18.04', 'macOS-10.14', 'windows-2019']
|
|
|
|
hugo-version: ['latest', '0.57.2']
|
2019-09-17 19:11:47 +00:00
|
|
|
extended: [true, false]
|
2019-09-22 00:37:17 +00:00
|
|
|
# exclude:
|
|
|
|
# - os: 'macOS-10.14'
|
|
|
|
# hugo-version: 'latest'
|
|
|
|
# extended: false
|
|
|
|
# - os: 'windows-2019'
|
|
|
|
# hugo-version: 'latest'
|
|
|
|
# extended: false
|
2019-09-15 23:27:57 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2019-09-21 01:41:21 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2019-09-15 23:27:57 +00:00
|
|
|
|
|
|
|
- name: Test action
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
hugo-version: ${{ matrix.hugo-version }}
|
|
|
|
extended: ${{ matrix.extended }}
|