actions-hugo/.github/workflows/test.yml
Shohei Ueda 3e55082b3f
gha: Use setup-node (#58)
* config: Add .nvmrc
* gha: Add setup-node step
* gha: Add step to read .nvmrc

Close #55
2019-10-09 00:20:05 +09:00

72 lines
1.4 KiB
YAML

name: 'Test'
on:
pull_request:
types: [opened, synchronize]
push:
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-10.14', 'windows-2019']
hugo-version: ['latest', '0.57.2']
extended: [true, false]
# exclude:
# - os: 'macOS-10.14'
# hugo-version: 'latest'
# extended: false
# - os: 'windows-2019'
# 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 }}