diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 00000000..b617d6db --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,3 @@ +self-hosted-runner: + labels: + - self-hosted-fast diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9038f81..bb7bd3b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,7 +134,12 @@ jobs: name: Native Linux Clippy needs: changes if: needs.changes.outputs.native == 'true' - runs-on: ubuntu-24.04 + # Main and merge-queue runs use the self-hosted runner (warm build cache); pull requests + # stay on GitHub's runners, and the runner itself refuses pull-request jobs. + runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-24.04' || 'self-hosted-fast' }} + env: + # Outside the checkout, so `git clean` keeps the warm build between runs. + CARGO_TARGET_DIR: ${{ github.event_name == 'pull_request' && 'target' || '/home/ci-runner/cargo-target/clippy' }} timeout-minutes: 30 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -158,9 +163,13 @@ jobs: name: Build tests needs: changes if: needs.changes.outputs.native == 'true' - runs-on: ubuntu-24.04 + # Main and merge-queue runs use the self-hosted runner (warm build cache); pull requests + # stay on GitHub's runners, and the runner itself refuses pull-request jobs. + runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-24.04' || 'self-hosted-fast' }} timeout-minutes: 45 env: + # Outside the checkout, so `git clean` keeps the warm build between runs. + CARGO_TARGET_DIR: ${{ github.event_name == 'pull_request' && 'target' || '/home/ci-runner/cargo-target/build-tests' }} CARGO_INCREMENTAL: "0" RUSTC_WRAPPER: sccache SCCACHE_GHA_ENABLED: "true" @@ -354,9 +363,13 @@ jobs: name: Doc tests needs: changes if: needs.changes.outputs.native == 'true' - runs-on: ubuntu-24.04 + # Main and merge-queue runs use the self-hosted runner (warm build cache); pull requests + # stay on GitHub's runners, and the runner itself refuses pull-request jobs. + runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-24.04' || 'self-hosted-fast' }} timeout-minutes: 45 env: + # Outside the checkout, so `git clean` keeps the warm build between runs. + CARGO_TARGET_DIR: ${{ github.event_name == 'pull_request' && 'target' || '/home/ci-runner/cargo-target/doc-tests' }} CARGO_INCREMENTAL: "0" RUSTC_WRAPPER: sccache SCCACHE_GHA_ENABLED: "true"