RSSHub/.github/workflows/test.yml

48 lines
1.1 KiB
YAML

name: test
on: [push, pull_request]
jobs:
jest:
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379/tcp
options: --entrypoint redis-server
strategy:
matrix:
node-version: ['14', '16']
name: Jest on Node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn
- run: npm run jest
env:
REDIS_URL: redis://localhost:${{ job.services.redis.ports[6379] }}/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2.1.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
docs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['14', '16']
name: Build docs on Node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn
- name: Build docs
run: npm run docs:build