From 75ca899809d5cb4aebb5a21203a84e568ffbbad0 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sun, 10 May 2026 05:21:09 +0800 Subject: [PATCH] ci: cache sandbox + install patchelf, run Linux elfpatch tests Two CI optimizations: 1. **Cache mcpp's self-bootstrapped sandbox** (musl-gcc + binutils + glibc + ninja + patchelf, ~800 MB) under a fixed key `mcpp-sandbox-Linux-mcpp0.0.3`. Toolchain set is version-pinned by mcpp 0.0.3, so the key needs no source / lock fingerprint. Cache-hit runs skip the bulk download. 2. **Install patchelf via apt + un-filter Linux elfpatch tests.** The previous filter `-ExecutorTest.ApplyElfpatchAuto_*` skipped five tests because the runner had no `patchelf` / `install_name_tool`. With apt's patchelf in place, the three `Linux*` tests now run; only the two `MacOs*` ones (which still need `install_name_tool`) stay filtered: `--gtest_filter=-ExecutorTest.ApplyElfpatchAuto_MacOs*`. --- .github/workflows/ci.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ee289c..b5502a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,8 +26,23 @@ jobs: - name: Install workspace tools (.xlings.json → mcpp 0.0.3) run: xlings install -y + # Cache mcpp's self-bootstrapped sandbox (musl-gcc + binutils + + # glibc + ninja + patchelf, ~800 MB). Toolchain set is pinned by + # mcpp 0.0.3, so a fixed key suffices. + - name: Cache mcpp sandbox + uses: actions/cache@v4 + with: + path: ~/.xlings/data/xpkgs/xim-x-mcpp/0.0.3/registry + key: mcpp-sandbox-${{ runner.os }}-mcpp0.0.3 + + # Linux elfpatch tests shell out to a `patchelf` binary; install + # the apt copy here so we can run them. `install_name_tool` is + # macOS-only — those `*MacOs*` tests stay filtered. + - name: Install patchelf (Linux elfpatch tests) + run: sudo apt-get update -qq && sudo apt-get install -y patchelf + - name: Build with mcpp run: mcpp build - - name: Run tests (skip ExecutorTest.ApplyElfpatchAuto_* — needs patchelf/install_name_tool which the runner doesn't ship) - run: mcpp test -- --gtest_filter=-ExecutorTest.ApplyElfpatchAuto_* + - name: Run tests (filter macOS-only tests) + run: mcpp test -- --gtest_filter=-ExecutorTest.ApplyElfpatchAuto_MacOs*