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

75 lines
1.4 KiB
YAML
Raw Normal View History

2019-09-15 23:27:57 +00:00
name: 'Test'
on:
pull_request:
2019-09-23 02:33:57 +00:00
types: [opened, synchronize]
2019-11-03 04:57:52 +00:00
paths-ignore:
- '**.md'
push:
2019-11-03 04:29:31 +00:00
paths-ignore:
- '**.md'
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:
2019-12-14 08:46:47 +00:00
- uses: actions/checkout@v2
2019-09-15 23:27:57 +00:00
- name: Read .nvmrc
2019-12-09 09:58:26 +00:00
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
id: nvm
2019-11-13 08:05:13 +00:00
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
2019-11-17 10:59:01 +00:00
- name: Cache
2019-11-27 13:05:49 +00:00
uses: actions/cache@v1
2019-11-17 10:59:01 +00:00
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
2019-11-13 08:05:13 +00:00
- run: npm ci
2019-09-15 23:27:57 +00:00
2019-11-13 08:05:13 +00:00
- run: npm run format:check
2019-11-13 08:05:13 +00:00
- run: npm run lint
2019-09-15 23:27:57 +00:00
2019-11-13 08:05:13 +00:00
- run: npm test
- name: Check ncc
run: |
npm run build
test -z "$(git status --short)"
- name: Upload test coverage
uses: actions/upload-artifact@v1
with:
name: coverage
path: coverage
2019-09-15 23:27:57 +00:00
test-prod:
runs-on: ${{ matrix.os }}
needs: test
2019-09-15 23:27:57 +00:00
strategy:
matrix:
2019-11-17 11:05:12 +00:00
os: ['ubuntu-18.04', 'macos-latest', 'windows-latest']
hugo-version: ['latest', '0.57.2']
extended: [true, false]
2019-09-15 23:27:57 +00:00
steps:
2019-12-14 08:46:47 +00:00
- uses: actions/checkout@v2
2019-09-15 23:27:57 +00:00
- name: Test action
uses: ./
with:
hugo-version: ${{ matrix.hugo-version }}
extended: ${{ matrix.extended }}