mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-28 07:14:40 +08:00
76 lines
2.0 KiB
YAML
76 lines
2.0 KiB
YAML
name: Frontend Check
|
|
|
|
on:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
HUSKY: 0
|
|
|
|
jobs:
|
|
frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- 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."
|
|
|
|
- name: Install pnpm
|
|
if: steps.check_frontend.outputs.frontend == 'true'
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
run_install: false
|
|
|
|
- uses: actions/setup-node@v6
|
|
if: steps.check_frontend.outputs.frontend == 'true'
|
|
with:
|
|
node-version: "24.13.0"
|
|
cache: "pnpm"
|
|
|
|
- name: Restore pnpm cache
|
|
if: steps.check_frontend.outputs.frontend == 'true'
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ~/.pnpm-store
|
|
key: "pnpm-shared-stable-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}"
|
|
restore-keys: |
|
|
pnpm-shared-stable-${{ 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
|