actions-hugo/.github/workflows/test.yml
2019-11-07 08:17:43 +09:00

76 lines
1.5 KiB
YAML

name: 'Test'
on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'
branches:
- master
jobs:
test:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- 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 }}'
- name: Install dependencies
run: npm install
- name: Format check
run: npm run format:check
- name: Lint
run: npm run lint
- name: Test
run: npm test
- name: Upload test coverage
uses: actions/upload-artifact@master
with:
name: coverage
path: coverage
test-prod:
runs-on: ${{ matrix.os }}
needs: test
strategy:
matrix:
os: ['ubuntu-18.04', 'macOS-latest', 'windows-latest']
hugo-version: ['latest', '0.57.2']
extended: [true, false]
# exclude:
# - os: 'macOS-latest'
# hugo-version: 'latest'
# extended: false
# - os: 'windows-latest'
# hugo-version: 'latest'
# extended: false
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Test action
uses: ./
with:
hugo-version: ${{ matrix.hugo-version }}
extended: ${{ matrix.extended }}