-
-
Notifications
You must be signed in to change notification settings - Fork 99
138 lines (114 loc) · 4.96 KB
/
Copy pathci.yml
File metadata and controls
138 lines (114 loc) · 4.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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 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 "- 现在额外包含:跨框架支持矩阵 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"