ci: 迁移本地 runner 并优化并行检查

This commit is contained in:
que01 committed 2026-10-23 15:40:50 +08:00
1 parent 371689484e
commit 965dd10219
6 files changed
+69 -35

No files matched your search

+18 -4
View File
@@ -3,7 +3,7 @@ name: CI
on:
push:
branches: [main]
# 纯文档提交不消耗 2 核 runner;需要状态时用 workflow_dispatch 手动触发。
# 纯文档提交不占用 runner;需要状态时用 workflow_dispatch 手动触发。
paths-ignore:
- "**.md"
# PR 不设置 paths-ignore:branch protection 的 required checks 必须始终上报,
@@ -33,6 +33,14 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Restore Turbo cache
uses: actions/cache@v4
with:
path: .turbo/cache
key: turbo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
restore-keys: |
turbo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-
turbo-${{ runner.os }}-${{ runner.arch }}-
- run: pnpm install --frozen-lockfile
- run: pnpm check
- run: pnpm test:api-routes
@@ -56,6 +64,14 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Restore Turbo cache
uses: actions/cache@v4
with:
path: .turbo/cache
key: turbo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
restore-keys: |
turbo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}-
turbo-${{ runner.os }}-${{ runner.arch }}-
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm build:admin:preview
@@ -67,7 +83,6 @@ jobs:
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [static]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
@@ -82,7 +97,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
key: playwright-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install Chromium
run: pnpm --filter @personal-brand/taro exec playwright install --with-deps chromium
- name: Run PR browser smoke
@@ -92,7 +107,6 @@ jobs:
name: API integration
runs-on: ubuntu-latest
timeout-minutes: 45
needs: [static]
services:
postgres:
image: postgres:16-alpine