f6f2ca9a29
owner 反馈 GitHub Actions UI 上 'Build image and deploy to staging' 等英文 job 名、'Docker Build summary / Build inputs / Build records include...' 等英文 summary 文本不符合中文开发者团队约定。 ## 汉化(全部显示字段) - ci.yml: workflow name '持续集成'、job '构建/Vet/测试' 和 'golangci-lint'、 所有 step name 中文(保留 golangci-lint / Go 等工具名) - deploy-staging.yml: workflow name '测试环境部署'、job '构建镜像并部署到 测试环境'、11 个 step name 中文 - doc/development-workflow-zh.md: 同步 4 处对 'Deploy Staging' 显示名的 引用,改为 '测试环境部署 (deploy-staging.yml)' 形式,以文件名锚定 ## 关闭 docker/build-push-action 英文 summary deploy-staging.yml workflow env 加 DOCKER_BUILD_SUMMARY=false。原来跑完 build 那个英文 'Docker Build summary / Build inputs / ...' 块在 GitHub Actions UI 上不再出现。部署结果靠 Telegram 通知传递。 ## actions 升级到支持 Node 24 的版本 GitHub Runner 报 Node 20 deprecated 警告,9 月 16 日强制移除。本次一次 性升级到当前 latest: - actions/checkout v4 -> v6 - actions/setup-go v5 -> v6 - docker/setup-buildx-action v3 -> v4 - docker/build-push-action v6 -> v7 - appleboy/scp-action v0.1.7 -> v1.0.0 (正式版) - appleboy/ssh-action v1.0.3 -> v1.2.5 - golangci/golangci-lint-action v6 -> v9 (Node 24,仍支持 version: latest 和 only-new-issues: true) 不改: - workflow .yml 文件名(gh CLI / 文档引用都用文件名锚定,不动) - secret 名 / env var 名(约定俗成全大写英文) - Telegram 通知正文(本来就是中文) ## 后续 agent prompt(架构师/QA/devops)里引用 'Build, vet, test' / 'Deploy Staging' 显示名的部分,PR merge 后另外 multica agent update 同步。 不在本 PR 范围。
73 lines
1.6 KiB
YAML
73 lines
1.6 KiB
YAML
name: 持续集成
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- internal
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-and-test:
|
|
name: 构建/Vet/测试
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
|
- name: 检出代码
|
|
uses: actions/checkout@v6
|
|
|
|
- name: 配置 Go 环境
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: 下载依赖模块
|
|
run: go mod download
|
|
|
|
- name: 构建
|
|
run: go build ./...
|
|
|
|
- name: 运行 go vet
|
|
run: go vet ./...
|
|
|
|
- name: 运行测试
|
|
run: go test -race -count=1 ./...
|
|
|
|
lint:
|
|
name: golangci-lint
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- name: 检出代码
|
|
uses: actions/checkout@v6
|
|
with:
|
|
# Fetch base ref so golangci-lint can diff against it for only-new-issues.
|
|
fetch-depth: 0
|
|
|
|
- name: 配置 Go 环境
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v9
|
|
with:
|
|
version: latest
|
|
args: --timeout=5m
|
|
# Legacy codebase has ~47 pre-existing lint issues (errcheck / unused
|
|
# carried over from upstream perfect-panel/server). Only flag NEW
|
|
# issues introduced by this PR so CI stays useful without forcing a
|
|
# mass cleanup. Backlog cleanup tracked separately.
|
|
only-new-issues: true
|