This repository was archived by the owner on Jun 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (126 loc) · 3.69 KB
/
Copy pathci.yml
File metadata and controls
155 lines (126 loc) · 3.69 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: CI
on:
push:
branches: ["**"]
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches: [main]
jobs:
frontend:
name: Frontend Lint & Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
working-directory: frontend
run: pnpm install --frozen-lockfile
- name: Lint
working-directory: frontend
run: pnpm lint
- name: Type check
working-directory: frontend
run: pnpm type-check
- name: Build
working-directory: frontend
run: pnpm build
frontend-test:
name: Frontend Tests
needs: frontend
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
working-directory: frontend
run: pnpm install --frozen-lockfile
- name: Run tests with coverage
working-directory: frontend
run: pnpm coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v6
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./frontend/coverage/lcov.info
flags: frontend
fail_ci_if_error: false
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./frontend/junit.xml
report_type: test_results
backend:
name: Backend Lint & Check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv sync --frozen
- name: Lint
run: uv run ruff check src/
- name: Format check
run: uv run ruff format --check src/
- name: Type check
run: uv run mypy src
backend-test:
name: Backend Tests
needs: backend
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- uses: astral-sh/setup-uv@v7
- name: Install dependencies with test group
run: uv sync --frozen --group test
- name: Run tests with coverage
env:
# 禁用 Ryuk 清理容器,避免在 CI 沙箱中因 socket 权限问题导致 Testcontainers 失败
TESTCONTAINERS_RYUK_DISABLED: "true"
run: uv run pytest tests/ -q --tb=short --cov=src --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v6
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: backend
fail_ci_if_error: false
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./junit.xml
report_type: test_results