Conversation
Move test-rust and build-release to self-hosted runners on tenerife for persistent Docker image cache and faster runner provisioning. Add concurrency group to cancel stale in-progress runs.
There was a problem hiding this comment.
Pull request overview
Migrates Rust CI jobs (test-rust and build-release) from GitHub-hosted ubuntu-22.04 runners to self-hosted runners for faster provisioning and persistent Docker cache. Adds a concurrency group to cancel stale CI runs on non-main branches.
Changes:
- Add concurrency group (
ci-${{ github.ref }}) with cancel-in-progress for non-main branches - Switch
test-rustandbuild-releasejobs fromubuntu-22.04toself-hosted
You can also share your feedback on Copilot code review. Take the survey.
- Mount /opt/ci-cache volumes into containers for persistent cargo registry, git, and target directories across CI runs - Remove Swatinem/rust-cache (replaced by local volume mounts) - Use per-runner CARGO_TARGET_DIR to avoid conflicts between runners - Move test-e2e and security-audit to self-hosted runners - Update target path references to use CARGO_TARGET_DIR env var
The runner context is not available in job-level env expressions. Use GITHUB_ENV in a step after checkout to set CARGO_TARGET_DIR based on the RUNNER_NAME shell variable instead.
There was a problem hiding this comment.
Pull request overview
Migrates Rust-heavy CI jobs to self-hosted runners with persistent volume-mounted caches (replacing Swatinem/rust-cache), and adds a concurrency group to cancel stale CI runs.
Changes:
- Switch
test-rust,build-release,test-e2e, andsecurity-auditjobs fromubuntu-22.04toself-hostedrunners - Replace GitHub Actions cache with host-mounted cargo registry/git/target volumes, namespacing target dirs per runner
- Add
concurrencygroup at workflow level to cancel in-progress runs on non-main branches
You can also share your feedback on Copilot code review. Take the survey.
| security-audit: | ||
| name: Security Audit | ||
| runs-on: ubuntu-22.04 | ||
| runs-on: self-hosted |
| test-e2e: | ||
| name: E2E Tests (Playwright) | ||
| runs-on: ubuntu-22.04 | ||
| runs-on: self-hosted |
| - /opt/ci-cache/cargo-registry:/usr/local/cargo/registry | ||
| - /opt/ci-cache/cargo-git:/usr/local/cargo/git | ||
| - /opt/ci-cache/target:/ci-target |
Per-runner isolation prevents concurrent cargo registry/git corruption when multiple runners execute on the same host simultaneously. Each runner gets its own subdirectory under /opt/ci-cache via symlinks. Also adds cargo cache volumes to the security-audit job.
There was a problem hiding this comment.
Pull request overview
Migrates four Rust-heavy CI jobs (test-rust, build-release, test-e2e, security-audit) from GitHub-hosted runners to self-hosted runners with persistent host-mounted cargo caches, replacing the Swatinem/rust-cache action.
Changes:
- Switch
runs-ontoself-hostedand mount/opt/ci-cache:/ci-cachefor persistent cargo/target caching namespaced per runner - Replace
Swatinem/rust-cachewith symlink-based cache setup steps and per-runnerCARGO_TARGET_DIR - Add a concurrency group to cancel stale CI runs on non-main branches
You can also share your feedback on Copilot code review. Take the survey.
| - name: Setup persistent cargo cache | ||
| run: | | ||
| mkdir -p /ci-cache/${RUNNER_NAME}/cargo-registry /ci-cache/${RUNNER_NAME}/cargo-git | ||
| ln -sfn /ci-cache/${RUNNER_NAME}/cargo-registry /usr/local/cargo/registry | ||
| ln -sfn /ci-cache/${RUNNER_NAME}/cargo-git /usr/local/cargo/git | ||
| echo "CARGO_TARGET_DIR=/ci-cache/${RUNNER_NAME}/target-e2e" >> $GITHUB_ENV |
- Increase timeout for Enter key login test (5s -> 15s) to handle slower redirect under load on self-hosted runners - Namespace cargo registry/git cache per-runner via symlinks to prevent corruption from concurrent jobs on the same host - Add cargo cache volumes to security-audit job
Summary
test-rust,build-release,test-e2e, andsecurity-auditjobs to self-hosted runners (tenerife-1 through tenerife-8) on a 32-core/125GB machineSwatinem/rust-cachewith persistent host-mounted cargo cache volumes (/opt/ci-cache)/ci-cache/${RUNNER_NAME}/) to prevent corruption from concurrent jobsHow it works
/opt/ci-cache:/ci-cache/usr/local/cargo/registryand/usr/local/cargo/gitto per-runner subdirectoriesCARGO_TARGET_DIRis set to a per-runner, per-job-type path (e.g.,/ci-cache/tenerife-3/target-test)github-actions-runner@{1..8}.service) allow full parallelismWhat stays on GitHub-hosted
test-sveltekit— fast (1.5 min), no Rustbuild-android— JDK/Gradle toolchain, fast (2 min)build-release-arm64— cross-compilation, needs separate setupTest plan