mirror of https://github.com/curbengh/hexo-yam
59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
name: Tester
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
tester:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
node-version: ['14', '16', '18']
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@v3.0.2
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3.2.0
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- name: Cache NPM dependencies
|
|
uses: actions/cache@v3.0.2
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-npm-cache
|
|
restore-keys: ${{ runner.os }}-npm-cache
|
|
- name: Install Dependencies
|
|
run: npm install
|
|
- name: Test
|
|
run: npm run test
|
|
env:
|
|
CI: true
|
|
coverage:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
node-version: ['14.x']
|
|
steps:
|
|
- uses: actions/checkout@v3.0.2
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3.2.0
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- name: Cache NPM dependencies
|
|
uses: actions/cache@v3.0.2
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-npm-cache
|
|
restore-keys: ${{ runner.os }}-npm-cache
|
|
- name: Install Dependencies
|
|
run: npm install
|
|
- name: Coverage
|
|
run: npm run test
|
|
env:
|
|
CI: true
|
|
- name: Upload coverage report to Codecov
|
|
uses: codecov/codecov-action@v3.1.0
|
|
with:
|
|
fail_ci_if_error: true
|