2019-09-16 01:27:57 +02:00
|
|
|
name: 'Test'
|
|
|
|
|
2019-09-22 02:37:17 +02:00
|
|
|
on:
|
2019-09-23 03:58:19 +02:00
|
|
|
pull_request:
|
2019-09-23 04:33:57 +02:00
|
|
|
types: [opened, synchronize]
|
2019-11-03 05:57:52 +01:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2019-09-22 02:37:17 +02:00
|
|
|
push:
|
2019-11-03 05:29:31 +01:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2019-10-01 13:10:45 +02:00
|
|
|
branches:
|
|
|
|
- master
|
2019-09-16 01:27:57 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2019-09-21 03:41:21 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2019-09-16 01:27:57 +02:00
|
|
|
|
2019-10-08 17:20:05 +02:00
|
|
|
- name: Read .nvmrc
|
|
|
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
|
|
|
id: nvm
|
|
|
|
|
2019-11-13 09:05:13 +01:00
|
|
|
- name: Setup Node
|
2019-10-08 17:20:05 +02:00
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
|
|
|
|
2019-11-17 11:59:01 +01:00
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v1.0.1
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-
|
|
|
|
|
2019-11-13 09:05:13 +01:00
|
|
|
- run: npm ci
|
2019-09-16 01:27:57 +02:00
|
|
|
|
2019-11-13 09:05:13 +01:00
|
|
|
- run: npm run format:check
|
2019-09-21 03:41:21 +02:00
|
|
|
|
2019-11-13 09:05:13 +01:00
|
|
|
- run: npm run lint
|
2019-09-16 01:27:57 +02:00
|
|
|
|
2019-11-13 09:05:13 +01:00
|
|
|
- run: npm test
|
2019-09-21 03:41:21 +02:00
|
|
|
|
2019-10-08 17:20:05 +02:00
|
|
|
- name: Upload test coverage
|
|
|
|
uses: actions/upload-artifact@master
|
2019-09-21 03:41:21 +02:00
|
|
|
with:
|
|
|
|
name: coverage
|
|
|
|
path: coverage
|
2019-09-16 01:27:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
test-prod:
|
2019-09-21 03:41:21 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
2019-09-17 21:11:47 +02:00
|
|
|
needs: test
|
2019-09-16 01:27:57 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2019-11-17 12:05:12 +01:00
|
|
|
os: ['ubuntu-18.04', 'macos-latest', 'windows-latest']
|
2019-09-21 03:41:21 +02:00
|
|
|
hugo-version: ['latest', '0.57.2']
|
2019-09-17 21:11:47 +02:00
|
|
|
extended: [true, false]
|
2019-11-17 12:05:12 +01:00
|
|
|
exclude:
|
|
|
|
- os: 'macos-latest'
|
|
|
|
hugo-version: 'latest'
|
|
|
|
extended: false
|
|
|
|
- os: 'windows-latest'
|
|
|
|
hugo-version: 'latest'
|
|
|
|
extended: false
|
2019-09-16 01:27:57 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2019-09-21 03:41:21 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2019-09-16 01:27:57 +02:00
|
|
|
|
|
|
|
- name: Test action
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
hugo-version: ${{ matrix.hugo-version }}
|
|
|
|
extended: ${{ matrix.extended }}
|