mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-16 23:40:32 +08:00
chore(ci): add frontend-check.yml (#5555)
* chore(ci): add frontend-check.yml * test * Revert "test" This reverts commit 24c4cf270cb86f0a9b1f3792c11c70195515326e.
This commit is contained in:
parent
da0106b1e8
commit
02d0a7e61f
71
.github/workflows/frontend-check.yml
vendored
Normal file
71
.github/workflows/frontend-check.yml
vendored
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
name: Frontend Check
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
HUSKY: 0
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
frontend:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check frontend changes
|
||||||
|
id: check_frontend
|
||||||
|
uses: dorny/paths-filter@v3
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
frontend:
|
||||||
|
- 'src/**'
|
||||||
|
- '**/*.js'
|
||||||
|
- '**/*.ts'
|
||||||
|
- '**/*.tsx'
|
||||||
|
- '**/*.css'
|
||||||
|
- '**/*.scss'
|
||||||
|
- '**/*.json'
|
||||||
|
- '**/*.md'
|
||||||
|
- 'package.json'
|
||||||
|
- 'pnpm-lock.yaml'
|
||||||
|
- 'pnpm-workspace.yaml'
|
||||||
|
- 'eslint.config.ts'
|
||||||
|
- 'tsconfig.json'
|
||||||
|
- 'vite.config.*'
|
||||||
|
|
||||||
|
- name: Skip if no frontend changes
|
||||||
|
if: steps.check_frontend.outputs.frontend != 'true'
|
||||||
|
run: echo "No frontend changes, skipping frontend checks."
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
if: steps.check_frontend.outputs.frontend == 'true'
|
||||||
|
with:
|
||||||
|
node-version: "lts/*"
|
||||||
|
|
||||||
|
- run: corepack enable
|
||||||
|
if: steps.check_frontend.outputs.frontend == 'true'
|
||||||
|
|
||||||
|
- name: Restore pnpm cache
|
||||||
|
if: steps.check_frontend.outputs.frontend == 'true'
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.pnpm-store
|
||||||
|
key: pnpm-store-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
pnpm-store-${{ runner.os }}-
|
||||||
|
|
||||||
|
- run: pnpm install --frozen-lockfile
|
||||||
|
if: steps.check_frontend.outputs.frontend == 'true'
|
||||||
|
|
||||||
|
- name: Run Prettier check
|
||||||
|
if: steps.check_frontend.outputs.frontend == 'true'
|
||||||
|
run: pnpm format:check
|
||||||
|
|
||||||
|
- name: Run ESLint
|
||||||
|
if: steps.check_frontend.outputs.frontend == 'true'
|
||||||
|
run: pnpm lint
|
||||||
|
|
||||||
|
- name: Run TypeScript typecheck
|
||||||
|
if: steps.check_frontend.outputs.frontend == 'true'
|
||||||
|
run: pnpm typecheck
|
||||||
@ -39,42 +39,6 @@ jobs:
|
|||||||
if: steps.check_rust.outputs.rust == 'true'
|
if: steps.check_rust.outputs.rust == 'true'
|
||||||
run: cargo fmt --manifest-path ./src-tauri/Cargo.toml --all -- --check
|
run: cargo fmt --manifest-path ./src-tauri/Cargo.toml --all -- --check
|
||||||
|
|
||||||
prettier:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Check Web changes
|
|
||||||
id: check_web
|
|
||||||
uses: dorny/paths-filter@v3
|
|
||||||
with:
|
|
||||||
filters: |
|
|
||||||
web:
|
|
||||||
- 'src/**'
|
|
||||||
- '**/*.js'
|
|
||||||
- '**/*.ts'
|
|
||||||
- '**/*.tsx'
|
|
||||||
- '**/*.css'
|
|
||||||
- '**/*.scss'
|
|
||||||
- '**/*.json'
|
|
||||||
- '**/*.md'
|
|
||||||
- '**/*.json'
|
|
||||||
|
|
||||||
- name: Skip if no Web changes
|
|
||||||
if: steps.check_web.outputs.web != 'true'
|
|
||||||
run: echo "No web changes, skipping prettier."
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
if: steps.check_web.outputs.web == 'true'
|
|
||||||
with:
|
|
||||||
node-version: "lts/*"
|
|
||||||
- run: corepack enable
|
|
||||||
if: steps.check_web.outputs.web == 'true'
|
|
||||||
- run: pnpm install --frozen-lockfile
|
|
||||||
if: steps.check_web.outputs.web == 'true'
|
|
||||||
- run: pnpm format:check
|
|
||||||
if: steps.check_web.outputs.web == 'true'
|
|
||||||
|
|
||||||
# taplo:
|
# taplo:
|
||||||
# name: taplo (.toml files)
|
# name: taplo (.toml files)
|
||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
Loading…
x
Reference in New Issue
Block a user