mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2025-05-04 22:35:27 +08:00

add support for ubuntu 22.04, drop ubuntu-18.04 - [starting with 8 of August 2022 support for ubuntu 18.04 is deprecated](https://github.blog/changelog/2022-08-09-github-actions-the-ubuntu-18-04-actions-runner-image-is-being-deprecated-and-will-be-removed-by-12-1-22/) - [ubuntu 22.04 is generally available](https://github.blog/changelog/2022-08-09-github-actions-ubuntu-22-04-is-now-generally-available-on-github-hosted-runners/)
59 lines
1.2 KiB
YAML
59 lines
1.2 KiB
YAML
name: 'Test'
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- '**.md'
|
|
pull_request:
|
|
paths-ignore:
|
|
- '**.md'
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- 'ubuntu-22.04'
|
|
- 'ubuntu-20.04'
|
|
- 'ubuntu-latest'
|
|
- 'macos-latest'
|
|
- 'windows-latest'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Read .nvmrc
|
|
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
|
|
id: nvm
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v3.4.1
|
|
with:
|
|
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
|
|
|
- run: npm ci
|
|
|
|
- name: Run prettier
|
|
if: startsWith(matrix.os, 'ubuntu-22.04')
|
|
run: npm run format:check
|
|
|
|
- name: Run eslint
|
|
if: startsWith(matrix.os, 'ubuntu-22.04')
|
|
run: npm run lint
|
|
|
|
- name: Run ncc
|
|
if: startsWith(matrix.os, 'ubuntu-22.04')
|
|
run: npm run build
|
|
|
|
- run: npm test
|
|
|
|
- name: Upload test coverage as artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: coverage-${{ matrix.os }}
|
|
path: coverage
|
|
|
|
- uses: codecov/codecov-action@v3
|