Files
crawler-plugin/.gitea/workflows/build.yml
T
Workflow config file is invalid. Please check your config file: model.ReadWorkflow: yaml: line 21: mapping values are not allowed in this context
huangzd1997 f142744ed4 feat(护栏): 后管补挂载测试与 readSource 逐文件台账,另加一支 CI job(runner 现状见正文)
这面此前 0 个挂载测试(@vue/test-utils 不在 package.json、node_modules 是空目录),
.vite 页面全靠"读源码做正则断言"钉住,改法一旦不是那个字面写法就失明。
装上 @vue/test-utils + vitest + jsdom 后补了 2 文件 7 例挂载测试,靶子选两处只 console
不给用户提示的失败路径(公司目录没取到时原先只剩"tab 条没画出来")。

source-pin 台账用锚点分段口径:实测这棵树 1,704 个 test(/it( 全部行首出现、无循环生成,
而括号配对切块会被正则字面量里的 ) 提前收口、漏 48 处——分母悄悄变小对"只许减"是沉默的,
所以另加一条"与独立出现次数对平"的断言。基线落在每个文件上:只钉"总数+文件数"两个标量时,
A 加一条配 B 减一条就能双双不动地绕过去。

⚠ 这支 CI job 今天是纸面的:Gitea Actions 只列得出 3 次 run,末次停在 2026-08-11 且全是
failure,此后 origin/master 又推进 1,131 笔没有产生任何 run。同一个 workflow 里 backend 的
mvn test、frontend 的 npm test 也一并不会执行——"CI 强制"这一项要成立,得先恢复 runner。
2026-10-08 17:37:00 +08:00

83 lines
3.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build Backend JAR
on:
push:
branches: [master]
workflow_dispatch:
inputs:
version:
description: Version tag
required: false
default: ""
jobs:
build:
runs-on: ubuntu-latest
container: maven:3.9-eclipse-temurin-21
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test (Java: unit + contract + ArchUnit)
working-directory: backend-java
run: mvn test -q
- name: Package
working-directory: backend-java
run: mvn clean package -DskipTests -q
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: backend-jar
path: backend-java/target/*.jar
frontend-test:
runs-on: ubuntu-latest
container: node:24-alpine
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
working-directory: frontend-vue
run: npm ci
- name: Type check (vue-tsc)
working-directory: frontend-vue
run: npm run build
- name: Frontend contract tests (npm test → node --test)
working-directory: frontend-vue
run: npm test
admin-frontend-test:
# 2026-10-08 加:后管此前是 0 CI 覆盖(本 workflow 只有 backend-java 与 frontend-vue 两个 job,
# `.gitea` 下 grep admin-frontend-vue 命中 0)⇒ 1,7xx 例契约/棘轮用例与 vue-tsc 只能手跑。
# 本机实跑过的:npm install(112 包 3m34s,再 72 包 2m35s)→ vue-tsc --noEmit 退出 0(49.7s)
# → node --test tests/*.test.ts 1,764 例全绿 → vitest run 挂载例 7 例全绿 → npm ci 复现通过。
# 没跑的那半:`npm run build` 的后半 `vite build` 本机没执行——它会重写 dist/,
# 而 dist/ 正是 scripts/_deploy_admin_vue.py 的发布输入,脏树上构建会把别人未提交的改动带进产物。
#
# ⚠ 前提未证实,别把这个 job 当成"CI 会跑":Gitea 26.4.5 的匿名接口
# /api/v1/repos/super/crawler-plugin/actions/tasks 只列得出 3 次 run,最后一个停在
# 2026-08-11T14:50(三次 status 全为 failure);此后 origin/master 又推进了 1,131 笔
# (含 2026-10-08 12:14:57 那次 push,仓库 updated_at 也是这一刻)却没有产生任何新 run。
# ⇒ 只能证到"这条 workflow 历史上真被 runner 执行过",证不到"现在还在执行"。
# 要让它真兜住这一面,先恢复 runner / 确认 Actions 未被关停。
runs-on: ubuntu-latest
container: node:24-alpine
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
working-directory: admin-frontend-vue
run: npm ci
- name: Type check + build (vue-tsc --noEmit && vite build)
working-directory: admin-frontend-vue
run: npm run build
- name: Admin contract & ratchet tests (node --test, 不是 vitest)
working-directory: admin-frontend-vue
run: node --test tests/*.test.ts
- name: Admin component mount tests (vitest + @vue/test-utils + jsdom)
working-directory: admin-frontend-vue
run: npm run test:mount