Skip to content

ci: bump setup-android to v4.0.4 to fix Set up Android SDK failures - #1353

Open
yoruuuchan wants to merge 2 commits into
AAswordman:devfrom
yoruuuchan:ci/fix-setup-android-deprecated-tools
Open

yoruuuchan wants to merge 2 commits into
AAswordman:devfrom
yoruuuchan:ci/fix-setup-android-deprecated-tools

Conversation

@yoruuuchan

Copy link
Copy Markdown
Contributor

依赖 / Dependency: 本 PR 叠在 #1351 之上(当前 diff 中包含其一行触发修复),请在 #1351 合并后再合入本 PR;届时 diff 将只剩 setup-android 升级。Stacked on #1351; merge after it.

变更说明 / Description

将 3 个 workflow 中共 5 处 android-actions/setup-android 固定引用从旧 v4 SHA(40fd30fb)升级到 v4.0.4(be39fa83),修复 Set up Android SDK 步骤必然失败的问题。

背景与动机 / Context and motivation

旧版 action 默认安装已被 Google 从 SDK 仓库移除的弃用 tools 包,sdkmanager tools 报 Warning: Failed to find package 'tools' 后以退出码 1 失败(见 #1352 与 run 37477899361)。该步骤在任何仓库代码执行前失败,导致 Android build / JVM tests 对所有 PR 恒红。上游已在 #537 修复(停止安装 tools 包),v4.0.2+ 均包含。

改动范围 / Changes

  • .github/workflows/pr-check.yml(3 处)、android-build.yml(1 处)、android-tests.yml(1 处):仅替换 action 固定 SHA 与版本注释。
  • 兼容性核对:新旧 runs.using 均为 node24,无输入重命名;新默认 cmdline-tools 22.0 与 workflow 显式安装的 platforms;34/36、build-tools;35.0.0、ndk;25.1.8937393、cmake;3.22.1 兼容;workflow 未依赖旧默认 cmdline-tools 20.0。

兼容性与风险 / Compatibility and risks

仅升级 CI action 版本,不改动任何作业步骤与应用代码;android-tests.yml 的 push: [main] 语义、android-build.yml 的手动触发语义不变。

关联 Issue / Related issue

Fixes #1352

验证方式 / Verification

检查或命令:
1. PyYAML 解析 3 个修改的 workflow 全部通过
2. check_repo_hygiene.py --base f1bbcd80 --candidate HEAD:errors=0 warnings=0(3 个文件)
3. 上游 compare 40fd30fb...be39fa83 共 9 个提交,逐一核对无破坏性变更(fix #537、默认 cmdline-tools 22.0、依赖升级、README)
4. 本 PR 的 PR Check 运行将使用 PR head 中的 workflow(即新版 action),Set up Android SDK 应不再报 'tools' 缺失
环境与变体:Windows / 仅 workflow YAML 改动
结果:如上;CI 运行结果见本 PR checks

检查清单 / Checklist

  • 我已记录可复现验证和未运行项原因
  • 日常开发 PR 的目标分支为 dev
  • 我已确认 Candidate checks 覆盖改动范围,并会处理技术失败项
  • 最终 diff 无无关、临时、生成、二进制或敏感内容
  • 已提供对应的回归、UI、文档/字符串或兼容性证据(CI-only 改动,证据为上游变更核对与本地检查输出)

The pull_request branch filter still targeted the stale `development`
branch, which was renamed to `dev` in late August 2026 (docs updated
in AAswordman#1060) and no longer exists. Since then PR Check has not triggered
for any pull request: recent PRs targeting `dev` (e.g. AAswordman#1330, AAswordman#1338,
AAswordman#1349) report no checks at all.

Set the filter to [dev, main] so that regular development PRs to `dev`
(PR template / CONTRIBUTING convention) and maintainer release sync PRs
to `main` (e.g. AAswordman#1222) are both checked, matching the original
branches: [main] intent before the development-branch era.

Fixes AAswordman#1350
The pinned setup-android SHA (old v4) installs the deprecated `tools`
package by default. Google has removed that package from the SDK
repository, so the Set up Android SDK step now fails in every job with
'Warning: Failed to find package \'tools\'' and sdkmanager exit code 1,
making Android build / JVM tests red on every run.

v4.0.4 includes upstream fix AAswordman#537 (stop installing the deprecated
`tools` package). Runtime stays node24 and no inputs change; the new
default cmdline-tools 22.0 is compatible with the explicit
platforms/build-tools/NDK packages installed by these workflows.

Stacked on AAswordman#1351 (PR Check trigger fix); merge after it.

@CATMIAOZHI CATMIAOZHI 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.

审计结论:✅ 批准合并

改动(3 个文件,+5/−5):将 3 个 workflow 中共 5 处 android-actions/setup-android 固定引用从旧 v4 SHA(40fd30fb…)升级到 v4.0.4(be39fa83…),修复 Set up Android SDK 步骤因安装已下架的 tools 包而必然失败的问题。

通过的检查:

  • 目标分支为 dev,符合规范;head SHA 与发帖 commit 一致。
  • 新 SHA be39fa83 经上游仓库 tags 接口核验,确为 v4.0.4 tag 的 commit,与 # v4.0.4 注释一致。
  • 上游 v4.0.4 源码(src/main.ts)包含弃用 tools 包的跳过逻辑(对应上游 #537 的修复),即本 PR 要解决的 Failed to find package 'tools' 失败根因。
  • dev 分支中全部 5 处 setup-android 引用都已替换,无遗漏;无应用代码、无权限声明、无密钥相关改动。
  • 本 PR head 上的 Candidate checks、Android build、Android JVM tests 均已成功,Set up Android SDK 步骤不再失败,修复效果已被 CI 实证。

问题:无 P0/P1/P2,无阻塞项。

后续可跟进(不阻塞):

  1. 本 PR 叠在 #1351 之上:当前与 dev 的 diff 还包含 #1351 的两笔提交(pr-check 触发条件、ToolPkg 文档)。本次审计仅覆盖本 PR 的 action 升级改动;#1351 的改动由其自身的审计覆盖。按作者说明 #1351 先合并,届时本 PR diff 只剩 5 处 SHA 替换,合并前建议再看一眼最终 diff。
  2. [P3] 可选:后续考虑用 Renovate/Dependabot 自动跟踪这类 CI action 版本,避免 pinned SHA 再次落后到全流水线恒红。

由 水晴喵的muse 审计

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants