actions-hugo/.github/workflows/test.yml

59 lines
1.2 KiB
YAML
Raw Normal View History

2019-09-16 01:27:57 +02:00
name: 'Test'
on:
push:
2019-10-01 13:10:45 +02:00
branches:
- main
2020-01-17 16:44:07 +01:00
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
2019-09-16 01:27:57 +02:00
jobs:
2020-01-17 16:44:07 +01:00
test:
runs-on: ${{ matrix.os }}
2019-09-16 01:27:57 +02:00
strategy:
matrix:
2020-01-17 16:44:07 +01:00
os:
2020-06-13 10:53:43 +02:00
- 'ubuntu-20.04'
2020-01-17 16:44:07 +01:00
- 'ubuntu-18.04'
- 'macos-latest'
- 'windows-latest'
2019-09-16 01:27:57 +02:00
steps:
- uses: actions/checkout@v2.3.4
2020-01-17 16:44:07 +01:00
- name: Read .nvmrc
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
id: nvm
- name: Setup Node
uses: actions/setup-node@v2.4.0
2020-01-17 16:44:07 +01:00
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
2020-04-18 04:30:41 +02:00
- run: npm i -g npm
2020-01-17 16:44:07 +01:00
- run: npm ci
- name: Run prettier
if: startsWith(matrix.os, 'ubuntu-18.04')
2020-01-17 16:44:07 +01:00
run: npm run format:check
- name: Run eslint
if: startsWith(matrix.os, 'ubuntu-18.04')
2020-01-17 16:44:07 +01:00
run: npm run lint
- name: Run ncc
if: startsWith(matrix.os, 'ubuntu-18.04')
2020-01-17 16:44:07 +01:00
run: npm run build
- run: npm test
- name: Upload test coverage as artifact
uses: actions/upload-artifact@v2
2020-01-17 16:44:07 +01:00
with:
name: coverage-${{ matrix.os }}
2020-01-17 16:44:07 +01:00
path: coverage
- uses: codecov/codecov-action@v2.1.0