From 02d0a7e61fd0a9338c0f129aefe5fbc09cfaf30b Mon Sep 17 00:00:00 2001 From: Sline Date: Fri, 21 Nov 2025 13:28:54 +0800 Subject: [PATCH] chore(ci): add frontend-check.yml (#5555) * chore(ci): add frontend-check.yml * test * Revert "test" This reverts commit 24c4cf270cb86f0a9b1f3792c11c70195515326e. --- .github/workflows/frontend-check.yml | 71 ++++++++++++++++++++++ .github/workflows/{fmt.yml => rustfmt.yml} | 36 ----------- 2 files changed, 71 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/frontend-check.yml rename .github/workflows/{fmt.yml => rustfmt.yml} (57%) diff --git a/.github/workflows/frontend-check.yml b/.github/workflows/frontend-check.yml new file mode 100644 index 000000000..8945bd9a8 --- /dev/null +++ b/.github/workflows/frontend-check.yml @@ -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 diff --git a/.github/workflows/fmt.yml b/.github/workflows/rustfmt.yml similarity index 57% rename from .github/workflows/fmt.yml rename to .github/workflows/rustfmt.yml index 58efc98b1..589e1bb30 100644 --- a/.github/workflows/fmt.yml +++ b/.github/workflows/rustfmt.yml @@ -39,42 +39,6 @@ jobs: if: steps.check_rust.outputs.rust == 'true' 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: # name: taplo (.toml files) # runs-on: ubuntu-latest