Skip to content

ci: migrate all CI to GitHub Actions and re-enable lint gates - #1316

Merged
33cn merged 11 commits into
masterfrom
ci/full-github-actions
Sep 2, 2026
Merged

33cn merged 11 commits into
masterfrom
ci/full-github-actions

Conversation

@33cn

@33cn 33cn commented Sep 2, 2026 •

Copy link
Copy Markdown
Owner

目标

仓库 CI 全部统一到 GitHub Actions:删除 Jenkins / GitLab CI / Travis / AppVeyor 配置,把 Jenkins ci-plugin 管线覆盖的 dapp 迁移到新 workflow,并重新启用被注释掉的 make checkgofmt / make linter 门槛。

变更

1. 迁移遗留 CI(1c8086515)

  • 删除:Jenkinsfile(ci-plugin)、Jenkinsfile-gitlab、.travis.yml、.gitlab-ci.yml、appveyor.yml
  • 新增 ci_dapps.yml:接管 Jenkins run all 实际覆盖但 GH Actions 缺失的 5 个 dapp —— autonomy / bridgevmxgo / evm2 / unfreeze / zksync(矩阵并行,fail-fast: false)
  • 新增 ci_fork_test.yml:迁移 GitLab 的 fork_test 系列(schedule 每天一次 + workflow_dispatch,对应原 onceEveryday 门控;forktest all 覆盖了原四个任务的超集)
  • README:换掉失效的 travis/appveyor 徽章

2. 修复 golinter.sh 使其真正生效(9e9942a9c)

  • --skip-dirs=["..."] 未加引号,被 golangci-lint 当正则解析成字符类,几乎匹配所有路径 → 全仓被静默跳过,make linter 空转(bug 自 2020 年引入)
  • res=$(...) 只捕获 stdout,golangci-lint 自身错误走 stderr 被吞掉,配置错误伪装成通过
  • 移除已废弃的死 linter(deadcode/interfacer/varcheck/structcheck/golint,v1.53.3 下是 no-op)
  • 去掉 --max-issues-per-linter/--max-same-issues 默认截断
  • make linter 的 shellcheck 加 -S warning(note/info 级不阻断 CI)

3. 全仓代码清理(9ec2c2dcc + cf6bdd085)

  • gofmt -s / goimports 全仓(447 文件,Go 1.19+ doc comment 格式为主,无语义变化)
  • 133 处 gosimple/unconvert/misspell + 8 处 ineffassign 修复
  • 36 处 shellcheck warning($? 在 echo/条件后被误读、引号缺失、垃圾残行)

4. 启用 CI 门槛(fd295cf07)

  • build.yml 放开 make checkgofmt 和 make linter(2025-06 被 7c6910a03/ca1288b4e 注释)

5. 删除冗余的 autotest 模式(10395bf4f)

  • 原 Jenkins/GitLab 时代的 autotest_ci(jerkinsci)与 build.yml 现有 autotest job 跑同一用例集(仅 docker 包装差异),已删除
  • autotest_tick(gitlabci)上游脚本"关自动挖矿后等出块"逻辑与当前链行为不匹配(无 bind 步骤,高度恒 0),已删除
  • ticket 生命周期不需要单独替代 job:build.yml 的 ci_base(make docker-compose,无 dapp 参数)经 dapptest 机制单独跑 plugin/dapp/ticket/cmd/test/test-rpc.sh(CreateBindMiner / SetAutoMining / GetTicketCount / CloseTickets),非零退出会 fail job——与 relay 同机制
  • 曾短暂加入 build_ticket.yml(make docker-compose dapp=ticket),review 指出其 testcase.sh 的 helper 在 dapp=ticket 路径下未加载(docker-compose.sh 仅在 DAPP 为空或 paracross 时 source dapp-test-rpc.sh),全部调用 command not found 且 set +e 假绿,已删除

6. Windows 原生构建(9765945a7)

  • 新增 build_windows.yml:在 windows-2022 runner 上原生执行 build.bat(对应原 appveyor 的 test_script),go 版本从 go.mod 读取
  • 与 manual_make_bin.yml 的 make all-arch(Linux 交叉编译)互补:交叉编译只验证能产出 PE 文件,不经过 Windows 原生工具链,也不执行 build.bat

7. 统一 action 版本(0f4b7e347,review 建议)

  • 全部 workflow 的 actions/checkout 升级到 v4、actions/setup-go 升级到 v5,不再依赖已废弃的 Node 16 运行时(release.yml 原为 v2,其余原为 v3)

8. push/pull_request 去重(357f4861e,review 建议)

  • 同仓库分支此前每次提交跑两遍全矩阵(push + pull_request synchronize)。全部 workflow 改为标准去重模式:push 仅在 master 触发,pull_request 覆盖所有 PR(含 fork);合并后 master 的 push 仍会跑全部 workflow,行为不变

9. 删除空转的 build_relay.yml(f2cc11bcb,review 建议)

  • 与已删的 build_ticket.yml 同类假绿:relay/cmd/build.sh 的 OUT_DIR/relayd 构建段自 2021 年(739e84e44,上游)起整段注释,build/ci/relay 不会生成,make docker-compose dapp=relay 只打印 dapp=relay not exist or is system dir 即返回 0
  • relay 的真实覆盖在 ci_base 的 dapptest(relay/test-rpc.sh,由 build.sh 仍生效的部分拷贝),无需替代 job;Makefile 的 relay 构建目标保留(手动可用)

覆盖对账

原 CI 去向
Jenkins ci-plugin(run all) system+evm+paracross+cross2eth/mix/rgbx/rollup 已有 workflow;剩余 5 个 → ci_dapps.yml
.gitlab-ci.yml fmt/lint/test/deploy/autotest build.yml 各 job
.gitlab-ci.yml fork_test 系列 ci_fork_test.yml
.travis.yml 全部 build.yml(唯一缺口是 lint,本次已重新启用)
appveyor.yml Windows 构建 build_windows.yml(Windows 原生跑 build.bat)+ manual_make_bin.yml 的 make all-arch 交叉编译产物
autotest_ci 与 build.yml autotest 重复,直接删除
autotest_tick 上游脚本与现链行为不匹配,删除;ticket 覆盖由 ci_base 的 dapptest 承担(见上)

顺带修复的 bug(均在提交说明中注明)

  • relay/paracross/issuance test-rpc.sh:echo_rst 收到 echo 的退出码(恒 0),永远报成功
  • auto_deploy.sh:elif [ $? -eq 2 ] 分支永不可达
  • dockerRelayerTestEvm.sh:fix}_ebrelayer${name} 垃圾残行
  • rgbx query/exec 测试缺 err 检查
  • qbft/tendermint Query_NodeInfo 占位串 UNKOWN → UNKNOWN

已知遗留(未在本次处理)

  • Makefile 的 autotest_ci/autotest_tick 目标保留(手动可用),仅移除 CI 引用

🤖 Generated with Claude Code

king and others added 6 commits September 2, 2026 04:44
- delete Jenkinsfile (ci-plugin), Jenkinsfile-gitlab, .travis.yml,
  .gitlab-ci.yml, appveyor.yml
- ci_dapps.yml: cover autonomy/bridgevmxgo/evm2/unfreeze/zksync that the
  Jenkins ci-plugin pipeline used to run (docker-compose-pre.sh run all)
- ci_fork_test.yml: port .gitlab-ci.yml fork_test series (schedule + dispatch)
- ci_autotest.yml: port make autotest_ci / autotest_tick
- README: replace dead travis/appveyor badges with GitHub Actions badge

Co-Authored-By: Claude <[email protected]>
- --skip-dirs=[...] unquoted: golangci-lint treats skip-dirs as a regex,
  so the bracket was parsed as a character class matching nearly every
  path, silently skipping the whole repo (bug present since 2020, which
  is why make linter always passed while 440+ files were unformatted)
- res=$(...) captured only stdout, swallowing golangci-lint errors from
  stderr and faking a pass on configuration errors
- drop deprecated linters deadcode/interfacer/varcheck/structcheck/golint
  (deprecated in golangci-lint v1.38-v1.49, no-ops in v1.53.3)
- add --max-issues-per-linter=0/--max-same-issues=0 so findings are not
  silently truncated at the default caps
- make linter: gate shellcheck at -S warning (note/info findings like
  SC2004/SC2317 do not fail CI)

Co-Authored-By: Claude <[email protected]>
…t/misspell fixes

- gofmt -s: mostly Go 1.19+ doc comment reformatting (//foo -> // foo),
  import grouping, and a few for-range simplifications (no semantics)
- goimports: import order
- gosimple: for-range over channel/select, copy() vs loop, append(slice...),
  fmt.Printf vs Println(Sprintf), drop redundant returns and bool compares,
  type-switch with bound variable, redundant map delete guards
- unconvert: drop redundant type conversions (verified identical types)
- misspell: fix typos in CLI help, log and error strings
- ineffassign: discard results that are never read; add missing err checks
  in rgbx query/exec tests
- verified: go vet, go build, make linter all pass

Co-Authored-By: Claude <[email protected]>
- issuance/relay/paracross test-rpc.sh: capture \$? into a variable instead
  of reading it after echo/condition (SC2319/SC2320); relay reported
  echo's exit code (always 0) instead of the intended failure
- auto_deploy.sh: capture SendFileAndDecompressFile exit code before the
  if/elif, the elif branch previously could never be taken
- mix testcase.sh: quote \$(cat ...) to prevent word splitting (SC2046)
- dockerRelayerTestEvm.sh: drop leftover 'fix}_ebrelayer\${name}' junk line
- qbft/tendermint: UNKOWN -> UNKNOWN in Query_NodeInfo placeholder strings

Co-Authored-By: Claude <[email protected]>
Un-comment make checkgofmt and make linter (disabled in 7c6910a and
ca1288b in 2025-06). Both now pass: golinter.sh is fixed, shellcheck is
gated at -S warning, and the repo is gofmt/goimports clean.

Co-Authored-By: Claude <[email protected]>
…ion test

The jerkinsci autotest mode (make autotest_ci) ran the same autotest
binary and case set as build.yml's existing autotest job (local mode),
only wrapped in docker, so its CI job was redundant. The gitlabci mode
(make autotest_tick) is an unmaintained upstream script whose 'close
auto mining then expect blocks' logic does not match current chain
behavior (height stays 0, no ticket bind step).

Replace both with a ticket dapp integration test:
- plugin/dapp/ticket/cmd/build/testcase.sh: standard dapp testcase
  covering the ticket lifecycle on the main chain (which already runs
  ticket consensus): auto-mining toggle, CreateBindMiner + sign/send,
  TicketList bound/closed, GetTicketCount, CloseTickets
- build.sh now copies cmd/build into build/ci/ticket like other dapps
- build_ticket.yml runs make docker-compose dapp=ticket

Note: an intermediate attempt enabled COMPOSE_COMPATIBILITY so the
jerkinsci container name matched the upstream script's v1-style name;
that path was abandoned along with ci_autotest.yml.

Co-Authored-By: Claude <[email protected]>
@33cn
33cn force-pushed the ci/full-github-actions branch from 10395bf to fd5d38f Compare September 2, 2026 04:45
manual_make_bin.yml 的 make all-arch 是在 ubuntu 上用 GOOS=windows
交叉编译(CGO_ENABLED=0),只验证能产出 PE 文件,不经过 Windows
原生工具链,也不执行 build.bat。删除 appveyor.yml 后这部分信号缺失。

新增 build_windows.yml,在 windows-2022 runner 上跑 build.bat,
对应原 appveyor 的 test_script。go 版本从 go.mod 读取,不再像
appveyor 那样硬编码 C:\go122;模块化项目无需 GOPATH/clone_folder。
build.bat 用 shell: cmd 调用,PowerShell 下 bat 的非零退出码不能
可靠传播。

Co-Authored-By: Claude Fable 5 <[email protected]>
@33cn
33cn requested a review from bysomeone September 2, 2026 05:21

@bysomeone bysomeone left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — needs changes before merge

Blocker: build_ticket.yml is green but runs nothing

The ticket integration test (.github/workflows/build_ticket.yml → make docker-compose dapp=ticket → plugin/dapp/ticket/cmd/build/testcase.sh) executes with every helper undefined. chain33_Http, chain33_BlockWait, chain33_SignAndSendTx and RETURN_RESP are defined in build/dapp-test-common.sh, which is only loaded via dapp-test-rpc.sh — and build/docker-compose.sh sources that only when DAPP is empty or paracross, not for dapp=ticket.

Evidence — the ci_ticket job passes (run 33594329867) yet its logs show all ten calls failing:

testcase.sh: line 21: chain33_BlockWait: command not found
testcase.sh: line 25/27/31/32/33/37/41/45/46/50: chain33_Http / chain33_SignAndSendTx: command not found

set +e lets these continue and the script exits 0, so the job is green while SetAutoMining / CreateBindMiner / TicketList / GetTicketCount / CloseTickets never run — this PR's claimed replacement for autotest_tick asserts nothing.

Fix: add source ./dapp-test-common.sh at the top of testcase.sh, then confirm the deploy log shows real API responses (no more command not found).

Suggestions (non-blocking)

  • New workflows use actions/checkout@v3 / actions/setup-go@v3 (Node 16 deprecated); build_windows.yml already uses v4/v5 — unify.
  • on: [push, pull_request] runs the full matrix twice per commit on same-repo branches — consider deduplicating (e.g. pull_request on the base repo only, or skip push for branches that also open PRs).

king and others added 2 commits September 2, 2026 08:58
Review feedback: the ticket job added in fd5d38f was green but ran
nothing — testcase.sh's helpers (chain33_Http, chain33_SignAndSendTx,
RETURN_RESP) are only loaded by docker-compose.sh when DAPP is empty or
paracross, so under dapp=ticket every call was "command not found" and
set +e let the script exit 0.

The same ticket lifecycle assertions already run in build.yml's ci_base
job: make docker-compose (no dapp) sources dapp-test-rpc.sh, whose
dapp_test_rpc() runs dapptest/ticket/test-rpc.sh separately and fails
the job on non-zero exit — the same mechanism that covers relay. So the
dedicated job is redundant; remove build_ticket.yml, the now-dead
testcase.sh, and restore ticket's build.sh to its pre-fd5d38ff1 state.

autotest_tick's removal rationale (unmaintained upstream script, height
stays 0) is unaffected.

Co-Authored-By: Claude <[email protected]>
Review suggestion: the new workflows mixed Node 16 actions (v3) with
build_windows.yml's v4/v5; the rest of the repo (including release.yml
at checkout/setup-go v2) was on the same deprecated versions. Upgrade
every workflow to checkout@v4 / setup-go@v5 so no workflow depends on
the deprecated Node 16 runtime.

Mechanical change only; every setup-go block already pins go-version-file
so v5's required version input is satisfied. YAML revalidated.

Co-Authored-By: Claude <[email protected]>
@33cn

33cn commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

@bysomeone 三条意见的处理:

  1. blocker(build_ticket.yml 绿色但空转):已验证你的判断——docker-compose.sh 仅在 DAPP 为空或 paracross 时 source dapp-test-rpc.sh,dapp=ticket 路径下 testcase.sh 的 helper 全部未定义,set +e 假绿。同时确认了 ticket 的真实覆盖路径:dapp=all(老 autotest 框架)不含 ticket(ticket 没有 autotest/ 目录),但 build.yml 的 ci_base(make docker-compose 无 dapp 参数)经 dapp_test_rpc 会单独跑 dapptest/ticket/test-rpc.sh 并检查 jobsTicket.log,非零退出会 fail job——与 relay 同机制,CreateBindMiner / SetAutoMining / GetTicketCount / CloseTickets 断言都在。因此没有给 testcase.sh 补 source,而是直接删除 build_ticket.yml 和死代码 testcase.sh,并把 ticket/cmd/build.sh 还原到该 commit 之前(480a49c46),不留与 dapptest 重复的 job。

  2. action 版本统一:全部 workflow 的 actions/checkout → v4、actions/setup-go → v5(0f4b7e347,release.yml 原为 v2,其余 v3),全仓不再依赖 Node 16。

  3. push+pull_request 双跑:确认是全仓既有模式(build.yml 等老 workflow 相同),非本 PR 引入,改动会超出本 PR 范围,留作后续单独处理。

另外本 PR 新增的 build_windows.yml(windows-2022 runner 原生跑 build.bat)补上了删除 appveyor 后、交叉编译(make all-arch)覆盖不到的 Windows 原生工具链验证。

@33cn
33cn requested a review from bysomeone September 2, 2026 09:03
Same-repo branches previously ran the full job matrix twice per commit
(once for push, once for pull_request synchronize). Adopt the standard
dedup pattern: push triggers only on master, pull_request covers all
PRs including forks. Behavior after merge is unchanged — master pushes
still run every workflow.

release.yml already used this pattern; automake.yml (workflow_dispatch)
and ci_fork_test.yml (schedule) are unaffected.

Co-Authored-By: Claude <[email protected]>
@33cn

33cn commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

补充:第 3 条(push+pull_request 双跑)已在 357f4861e 一并修复——全部 workflow 改为 push 仅 master 触发 + pull_request 全覆盖的标准去重模式,与 release.yml 既有写法一致。

@bysomeone

Copy link
Copy Markdown
Collaborator

发现 ci_relay 也是空跑假绿(和已删的 build_ticket 同类):

  • relay/cmd/build.sh 的 OUT_DIR/relayd 构建整段被注释,build/ci/relay 目录不会生成,make docker-compose dapp=relay 实际只打印 #### dapp=relay not exist or is system dir #### 后返回 0,没跑任何 relay 测试;
  • relay 真实覆盖在 ci_base 的 dapptest(relay/test-rpc.sh)。

建议删掉 build_relay.yml,并不要把 ci_relay 设为 required status check。

bysomeone
bysomeone previously approved these changes Sep 2, 2026
Same class as the removed build_ticket.yml: relay/cmd/build.sh has had
its OUT_DIR/relayd build section commented out since 2021 (739e84e,
upstream), so build/ci/relay is never created and
`make docker-compose dapp=relay` only prints
"dapp=relay not exist or is system dir" before returning 0.

Relay's real coverage runs in build.yml's ci_base job via dapptest
(relay/test-rpc.sh, copied by the still-active part of build.sh), so no
replacement job is needed. This moves the item out of the PR's known
leftovers.

Co-Authored-By: Claude <[email protected]>
@33cn

33cn commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

确认属实,已删除 build_relay.yml(f2cc11bcb):relay/cmd/build.sh 的 OUT_DIR/relayd 段自 2021 年(739e84e44,上游)起整段注释,build/ci/relay 不会生成,job 假绿 5 年。relay 覆盖由 ci_base 的 dapptest(relay/test-rpc.sh)承担,与 ticket 同机制。该条目已从 PR 的"已知遗留"移入变更说明。

@33cn
33cn merged commit b04a1b8 into master Sep 2, 2026
20 checks passed
@33cn
33cn deleted the ci/full-github-actions branch September 2, 2026 12:02
@33cn

33cn commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.71.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@33cn 33cn added the released label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants