fix: stabilize taro vite watch hmr regression #588
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, next] | |
| pull_request: | |
| types: [opened, synchronize] | |
| paths-ignore: | |
| - '**/*.md' | |
| - '.changeset/**' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| quality: | |
| name: Quality Gate (ubuntu-latest, 22) | |
| timeout-minutes: 35 | |
| runs-on: ubuntu-latest | |
| # Remote Caching enabled - configure TURBO_TOKEN and TURBO_TEAM in repository settings | |
| env: | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Security Audit | |
| run: pnpm audit --audit-level=moderate | |
| continue-on-error: true | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Build | |
| run: pnpm build | |
| - name: E2E Static | |
| run: pnpm e2e:static | |
| - name: E2E Preprocessor Source | |
| run: pnpm e2e:preprocessor | |
| - name: E2E Framework Support | |
| run: pnpm exec cross-env E2E_FRAMEWORK_SUPPORT=1 vitest run -c ./e2e/vitest.e2e.config.ts e2e/framework-ci-support.test.ts | |
| - name: Test | |
| run: pnpm test | |
| - name: CI Status Note | |
| if: always() | |
| run: | | |
| { | |
| echo "## CI 状态说明" | |
| echo "- 本工作流负责:lint、build、unit/integration tests、coverage 上传。" | |
| echo "- 现在额外包含:\`pnpm e2e:static\`,用于保证 v5 生成示例和静态快照与 CI 一致。" | |
| echo "- 现在额外包含:\`pnpm e2e:preprocessor\`,用于保证 Sass/Less 等预处理器 Tailwind 入口在真实 demo 中可构建。" | |
| echo "- 现在额外包含:跨框架支持矩阵 e2e,用于保证 demo 构建入口与模板静态输出一致。" | |
| echo "- \`pnpm e2e:ci\` 仍保留本地/专项使用,其中 hot-update/watch 覆盖由独立工作流承载。" | |
| echo "- \`Compatibility Gate\` 负责跨系统/多 Node 的核心回归,避免把全仓 lint/build 在每个矩阵里重复执行。" | |
| echo "- \`pnpm e2e:watch\` 已拆分到独立工作流:\`E2E Watch\`(.github/workflows/e2e-watch.yml)。" | |
| echo "- website SEO 质量门禁已拆分到独立工作流:\`Website SEO Quality\`(.github/workflows/website-seo-quality.yml)。" | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| compatibility: | |
| name: Compatibility Gate (${{ matrix.os }}, ${{ matrix.node-version }}, ${{ matrix.scenario }}) | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJSON(github.event_name == 'workflow_dispatch' && '[{"os":"ubuntu-latest","node-version":20,"scenario":"node20-core"},{"os":"ubuntu-latest","node-version":24,"scenario":"node24-core"},{"os":"windows-latest","node-version":20,"scenario":"windows-node20-core"},{"os":"windows-latest","node-version":22,"scenario":"windows-node22-core"},{"os":"windows-latest","node-version":24,"scenario":"windows-node24-core"},{"os":"macos-latest","node-version":22,"scenario":"macos-node22-core"}]' || '[{"os":"windows-latest","node-version":22,"scenario":"windows-node22-core"}]') }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build core package dependency closure | |
| run: pnpm --filter weapp-tailwindcss... run build | |
| - name: Run core compatibility regression tests | |
| run: > | |
| pnpm --filter weapp-tailwindcss exec vitest run | |
| test/bundlers/module-graph.unit.test.ts | |
| test/bundlers/vite-bundle-entries.unit.test.ts | |
| test/bundlers/vite-plugin.uni-app-x.unit.test.ts | |
| test/tailwindcss/patcher-resolve.test.ts | |
| test/tailwindcss/targets.log.test.ts | |
| test/watch-hmr-coverage-matrix.unit.test.ts | |
| - name: Compatibility Status Note | |
| if: always() | |
| run: | | |
| { | |
| echo "## Compatibility Gate" | |
| echo "- os: ${{ matrix.os }}" | |
| echo "- node: ${{ matrix.node-version }}" | |
| echo "- scenario: ${{ matrix.scenario }}" | |
| echo "- 覆盖重点:Windows/跨平台路径归一、Vite bundle graph、Tailwind patch resolve、watch HMR 覆盖矩阵。" | |
| } >> "$GITHUB_STEP_SUMMARY" |