Files
RSSHub/.github/workflows/test.yml
T
neilnaveen ba496a625c chore: Set permissions for GitHub actions (#9644)
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2022-04-28 21:01:45 +08:00

67 lines
1.6 KiB
YAML

name: test
on: [push, pull_request]
permissions:
contents: read
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@v3
- uses: actions/setup-node@v3
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@v3
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@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn
- name: Build docs
run: npm run docs:build
all:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['14', '16']
name: Build radar and maintainer on Node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn
- name: Build radar and maintainer
run: npm run build:all