ci: 工具缓存 composite action 修 nextest 安装

This commit is contained in:
2026-10-10 11:10:22 +00:00
parent 1f31d7d448
commit 9676c31ca8
3 changed files with 42 additions and 8 deletions
+39
View File
@@ -0,0 +1,39 @@
name: Setup tools (sccache / mold / nextest)
# 工具缓存:sccache、mold、nextest 统一装到 ~/oxide-tools/bin,按固定 key 跨 run
# 持久缓存。首跑各 job 各装一次(冗余但一次性),之后每个 run 直接 restore、
# 秒级。nextest 走官方预编译二进制直下,不依赖 main 分支安装脚本(脚本会被移动
# 而 404)。sccache 与 mold 经 apt 装到 /usr/bin 后拷入 ~/oxide-tools/bin,
# 使缓存路径落在用户可写目录(/usr/bin 缓存受权限限制)。
description: 恢复工具缓存;缺失时安装 sccache、mold、nextest 并存缓存
runs:
using: composite
steps:
- name: Restore tool cache
id: tool-cache
uses: actions/cache/restore@v4
with:
path: ~/oxide-tools/bin
key: oxide-tools-ubuntu-v1
- name: Install tools (cache miss)
if: steps.tool-cache.outputs.cache-hit != 'true'
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y sccache mold
mkdir -p "$HOME/oxide-tools/bin"
cp /usr/bin/sccache /usr/bin/mold "$HOME/oxide-tools/bin/"
curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C "$HOME/oxide-tools/bin"
- name: Add tools to PATH
shell: bash
run: echo "$HOME/oxide-tools/bin" >> "$GITHUB_PATH"
- name: Save tool cache
if: steps.tool-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ~/oxide-tools/bin
key: oxide-tools-ubuntu-v1