mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
ci(release): stabilize sccache startup to fix slow builds
- Export ACTIONS_* env to child procs for GHAC - Pre-stop then start sccache to avoid port races - Set SCCACHE_IDLE_TIMEOUT for job lifespan - Keep local dir cache as fallback via actions/cache - Ensure RUSTC_WRAPPER and GHAC envs are set reliably
This commit is contained in:
@@ -132,6 +132,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
|
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
|
||||||
|
echo "SCCACHE_IDLE_TIMEOUT=1800" >> "$GITHUB_ENV" # keep server alive during job
|
||||||
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
|
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
|
||||||
case "${{ runner.os }}" in
|
case "${{ runner.os }}" in
|
||||||
macOS)
|
macOS)
|
||||||
@@ -146,6 +147,13 @@ jobs:
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Ensure GH Actions cache credentials are inherited by child processes (sccache server)
|
||||||
|
- name: Export GH cache env for children
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "ACTIONS_CACHE_URL=${ACTIONS_CACHE_URL}" >> "$GITHUB_ENV"
|
||||||
|
echo "ACTIONS_RUNTIME_TOKEN=${ACTIONS_RUNTIME_TOKEN}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
# ✅ Persist the local sccache directory as a shared, stable fallback across runs
|
# ✅ Persist the local sccache directory as a shared, stable fallback across runs
|
||||||
- name: Cache sccache directory (fallback)
|
- name: Cache sccache directory (fallback)
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -217,6 +225,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd codex-rs
|
cd codex-rs
|
||||||
|
|
||||||
|
echo "Restarting sccache server to avoid race conditions"
|
||||||
|
sccache --stop-server || true
|
||||||
echo "Starting sccache server (GHAC preferred)"
|
echo "Starting sccache server (GHAC preferred)"
|
||||||
if ! sccache --start-server; then
|
if ! sccache --start-server; then
|
||||||
echo "sccache GHAC failed to start; switching to local disk cache"
|
echo "sccache GHAC failed to start; switching to local disk cache"
|
||||||
@@ -399,4 +409,4 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
release-assets/*
|
release-assets/*
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user