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.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user