From 6d8bd80392fac3b6e51368ddaeb00432fe8fac14 Mon Sep 17 00:00:00 2001 From: can1357 Date: Sun, 14 Jun 2026 23:07:54 +0200 Subject: [PATCH] ci(workflows): share rust sccache via in-cluster RustFS S3 on self-hosted runners Self-hosted omp-kata runners now inject a shared S3 (RustFS, in-cluster) sccache backend via pod env (SCCACHE_BUCKET/ENDPOINT/REGION + AWS creds). The Enable-sccache step branches on SCCACHE_BUCKET: when set, sccache reads the S3 config from the inherited environment; otherwise GitHub-hosted runners (macOS, ubuntu-arm) keep the GHA cache backend since they can't reach the private RustFS. --- .github/actions/build-native/action.yml | 19 +++++++++++++------ .github/workflows/ci.yml | 10 +++++++++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/actions/build-native/action.yml b/.github/actions/build-native/action.yml index 7ed5f7327..00798234d 100644 --- a/.github/actions/build-native/action.yml +++ b/.github/actions/build-native/action.yml @@ -103,18 +103,25 @@ runs: - name: Setup sccache uses: mozilla-actions/sccache-action@v0.0.10 - name: Enable sccache for cargo - # `CARGO_INCREMENTAL=0` is required: sccache silently skips caching - # when incremental is enabled, which would turn the wrapper into a - # no-op. rust-cache also sets this today, but pin it here so sccache - # stays effective if rust-cache is removed or changes defaults. Also - # overrides `profile.dev.incremental = true` for `bun run test:rs`. + # `CARGO_INCREMENTAL=0` is required: sccache silently skips caching when + # incremental is enabled, turning the wrapper into a no-op. The backend + # is conditional: self-hosted omp-kata runners inject a shared S3 (RustFS) + # cache via pod env (SCCACHE_BUCKET/ENDPOINT/REGION + AWS creds) that + # sccache reads from the inherited environment; GitHub-hosted runners + # (macOS, ubuntu-arm) can't reach the private RustFS and keep the GHA + # cache backend. shell: bash run: | { - echo "SCCACHE_GHA_ENABLED=true" echo "RUSTC_WRAPPER=sccache" echo "CARGO_INCREMENTAL=0" } >> "$GITHUB_ENV" + if [ -n "${SCCACHE_BUCKET:-}" ]; then + echo "sccache backend: shared S3 ($SCCACHE_BUCKET @ $SCCACHE_ENDPOINT)" + else + echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV" + echo "sccache backend: GitHub Actions cache" + fi - uses: taiki-e/install-action@v2 if: inputs.target == '' with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ccc08d45..566268cea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -546,13 +546,21 @@ jobs: - name: Setup sccache uses: mozilla-actions/sccache-action@v0.0.10 - name: Enable sccache for cargo + # Conditional backend: self-hosted omp-kata injects a shared S3 + # (RustFS) sccache via pod env; GitHub-hosted runners keep the GHA + # cache. CARGO_INCREMENTAL=0 keeps sccache from silently no-oping. shell: bash run: | { - echo "SCCACHE_GHA_ENABLED=true" echo "RUSTC_WRAPPER=sccache" echo "CARGO_INCREMENTAL=0" } >> "$GITHUB_ENV" + if [ -n "${SCCACHE_BUCKET:-}" ]; then + echo "sccache backend: shared S3 ($SCCACHE_BUCKET @ $SCCACHE_ENDPOINT)" + else + echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV" + echo "sccache backend: GitHub Actions cache" + fi - name: Cache bun dependencies uses: actions/cache@v4 with: