Skip to content

Commit

Permalink
Merge pull request #936 from DIYgod/master
Browse files Browse the repository at this point in the history
[pull] master from diygod:master
  • Loading branch information
pull[bot] authored May 5, 2023
2 parents 6723517 + e3a3173 commit d0e200c
Show file tree
Hide file tree
Showing 33 changed files with 18,291 additions and 17,258 deletions.
8 changes: 4 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@

"onCreateCommand": "sudo apt-get update && export DEBIAN_FRONTEND=noninteractive && sudo apt-get -y install --no-install-recommends ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3 libexpat1 libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 wget xdg-utils redis-server && sudo apt-get autoremove -y && sudo apt-get clean -y && sudo rm -rf /var/lib/apt/lists/*",

"updateContentCommand": "yarn && yarn --cwd docs",
"updateContentCommand": "pnpm i && pnpm i -C docs && pnpm rb",

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "yarn && yarn --cwd docs",
"postCreateCommand": "pnpm i && pnpm i -C docs && pnpm rb",

// Disable auto start dev env since codespaces sometimes fails to attach to the terminal
// "postAttachCommand": {
// "app": "yarn",
// // "docs": "yarn docs:dev"
// "app": "pnpm i",
// // "docs": "pnpm run docs:dev"
// },

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
Expand Down
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# folders
.devcontainer
.github
.idea
Expand All @@ -11,13 +12,16 @@ coverage
docs
node_modules
test

# files
.codecov.yml
.dockerignore
.editorconfig
.env
.eslint*
.gitignore
.gitpod.yml
.markdownlint.jsonc
.prettier*
.(yarn|npm|nvm)rc
*.md
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/build-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js v18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Build file
run: yarn && npm run build:all
cache: 'pnpm'
- name: Install dependencies (yarn)
run: pnpm i
- name: Build assets
run: npm run build:all
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/comment-on-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3 # just need its cache
with:
node-version: 18
cache: 'yarn'
- name: Install dependencies (yarn) # needed since we need to parse markdown, so we also use got instead
run: yarn
cache: 'pnpm'
- name: Install dependencies (pnpm) # needed since we need to parse markdown, so we also use got instead
run: pnpm i
- name: Generate feedback
uses: actions/github-script@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- '!**/radar-rules.js'
- 'Dockerfile'
- 'package.json'
- 'yarn.lock'
- 'pnpm-lock.yaml'
workflow_dispatch: ~

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- '!**/radar-rules.js'
- 'Dockerfile'
- 'package.json'
- 'yarn.lock'
- 'pnpm-lock.yaml'
types: [opened, reopened, synchronize, edited]
# Please, always create a pull request instead of push to master.

Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install
- run: yarn install
working-directory: ./docs
cache: 'pnpm'
- run: pnpm i
- run: pnpm i
working-directory: docs
- run: npm run format
- name: Commit files
run: |
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/issue-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node.js v18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies (yarn)
run: yarn
- name: Install dependencies (pnpm)
run: pnpm i

- name: Fetch affected routes
id: fetchRoute
Expand All @@ -76,7 +81,7 @@ jobs:
- name: Start RSSHub
if: env.TEST_CONTINUE
run: yarn start &
run: pnpm start &
env:
ALLOW_USER_HOTLINK_TEMPLATE: true
ALLOW_USER_SUPPLY_UNSAFE_DOMAIN: true
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,24 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- run: npm install -g npm
- name: Install dependencies (pnpm)
run: pnpm i
- name: Run postinstall script for dependencies
run: pnpm rb
- name: Release
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
npx version-from-git --allow-same-version --template 'master.short'
- name: Publish to npmjs
run: npm publish --provenance --access public
run: pnpm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
10 changes: 7 additions & 3 deletions .github/workflows/pr-deploy-route-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,19 @@ jobs:
-p 1200:1200 \
rsshub:latest
- uses: pnpm/action-setup@v2
with:
version: 8

- uses: actions/setup-node@v3 # just need its cache
if: (env.TEST_CONTINUE)
with:
node-version: 18
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies (yarn) # `got` needed since `github.request` disallows HTTP requests
- name: Install dependencies (pnpm) # `got` needed since `github.request` disallows HTTP requests
if: (env.TEST_CONTINUE)
run: yarn
run: pnpm i

- name: Generate feedback
if: (env.TEST_CONTINUE)
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn
cache: 'pnpm'
- run: pnpm i
- name: Lint
run: yarn lint
run: pnpm run lint

eslint-warning:
name: Lint
Expand All @@ -28,13 +31,16 @@ jobs:
security-events: write
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn
cache: 'pnpm'
- run: pnpm i
- name: Lint
run: yarn lint
run: pnpm run lint
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true
Expand Down
45 changes: 31 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- '!**/radar.js'
- '!**/radar-rules.js'
- 'package.json'
- 'yarn.lock'
- 'pnpm-lock.yaml'
- '.github/workflows/test.yml'
pull_request: ~

Expand Down Expand Up @@ -40,14 +40,19 @@ jobs:
with:
api_key: ${{ secrets.FORESIGHT_KEY }}
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies (yarn)
run: yarn
cache: 'pnpm'
- name: Install dependencies (pnpm)
run: pnpm i
- name: Run postinstall script for dependencies
run: pnpm rb
- name: Test all and generate coverage
run: npm run jest:coverage
run: pnpm run jest:coverage
env:
REDIS_URL: redis://localhost:${{ job.services.redis.ports[6379] }}/
- name: Upload coverage to Codecov
Expand Down Expand Up @@ -87,12 +92,17 @@ jobs:
name: Jest puppeteer on Node ${{ matrix.node-version }} with ${{ matrix.chromium.name }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies (yarn)
run: yarn
cache: 'pnpm'
- name: Install dependencies (pnpm)
run: pnpm i
- name: Run postinstall script for dependencies
run: pnpm rb
- name: Install Chromium
if: ${{ matrix.chromium.dependency != '' }}
# 'chromium-browser' from Ubuntu APT repo is a dummy package. Its version (85.0.4183.83) means
Expand All @@ -108,7 +118,7 @@ jobs:
sudo apt-get update
sudo apt-get install -yq --no-install-recommends ${{ matrix.chromium.dependency }}
- name: Test puppeteer
run: npm run jest puppeteer
run: pnpm run jest puppeteer
env: ${{ fromJSON(matrix.chromium.environment) }}

docs:
Expand All @@ -124,17 +134,21 @@ jobs:
name: Build docs on Node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: docs/yarn.lock
- run: yarn
cache: 'pnpm'
cache-dependency-path: docs/pnpm-lock.yaml
- run: pnpm i
- name: Set environment variable for Node v16 above
if: ${{ matrix.node-version > '16' }}
run: echo "NODE_OPTIONS=--openssl-legacy-provider" >> $GITHUB_ENV
- name: Build docs
run: npm run docs:build
working-directory: docs
- name: Unset environment variable for Node v16 above
if: ${{ matrix.node-version > '16' }}
run: echo "NODE_OPTIONS=''" >> $GITHUB_ENV
Expand All @@ -149,11 +163,14 @@ jobs:
name: Build radar and maintainer on Node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn
cache: 'pnpm'
- run: pnpm i
- name: Build radar and maintainer
run: npm run build:all

Expand Down
Loading

1 comment on commit d0e200c

@vercel
Copy link

@vercel vercel bot commented on d0e200c May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.