diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95c60a0ea..7804de089 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,10 +32,8 @@ # jobs, so they never wait behind a build). For pushes to main and the merge queue only, the # repository checks, Clippy, the doc tests, the reference tests and all four test shards run on the # self-hosted runners (`self-hosted-fast`, warm build directories via scripts/ci/warm-target.sh); -# a pull request runs them on GitHub's runners, so it never holds up the queue. Fork PRs' Linux -# jobs run on the isolated, ephemeral `self-hosted-untrusted` runners (no warm caches) when the -# PR number ends in 7, 8 or 9 (the rest of the fork PRs, and everything else, run on GitHub's -# runners, which have far more free slots). +# a pull request runs them on GitHub's runners, so it never holds up the queue. Fork PRs run +# there too: the runners are ephemeral and fork runs get no secrets. # Where the test shards run on GitHub's runners, the test archive is built there too: the # self-hosted machine has a newer glibc, so its binaries wouldn't start on ubuntu-24.04, while the # archive runs there unchanged (same /home/runner/work checkout path). The self-hosted shards @@ -48,7 +46,7 @@ # ubuntu-24.04, so the test archive and recorded goldens behave the same. Windows jobs stay on # windows-latest. Blacksmith runners report runner.environment == 'self-hosted' as well, so steps # don't ask the runner where they run: they read the routing that chose it (Select checks' `local` -# and `untrusted` outputs, or the trusted-run condition in jobs that don't need Select checks). +# output, or the trusted-run condition in jobs that don't need Select checks). name: CI on: @@ -124,11 +122,9 @@ jobs: # The passing run a merge of main carries forward (its URL), when this push is only that. carried: ${{ steps.paths.outputs.carried }} # The fast self-hosted runners are kept for main and the merge queue (the pre-merge gate); - # pull requests, same-repo ones included, take the GitHub-hosted or untrusted paths. Steps - # read these two to know where their job runs (see the top of this file). + # pull requests, same-repo ones included, run on GitHub's runners. Steps read this to know + # where their job runs (see the top of this file). local: ${{ github.event_name == 'merge_group' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} - # Fork pull requests whose Linux jobs run on the self-hosted-untrusted runners. - untrusted: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) && (endsWith(format('{0}', github.event.pull_request.number), '7') || endsWith(format('{0}', github.event.pull_request.number), '8') || endsWith(format('{0}', github.event.pull_request.number), '9')) }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -283,8 +279,8 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: components: rustfmt - # The trusted self-hosted runners keep their build directory and Cargo home instead; the - # untrusted ones (fork pull requests) start empty and restore main's cache, read-only. + # The self-hosted runners keep their build directory and Cargo home instead; everything + # else restores main's cache (read-only off main). - if: ${{ !(github.event_name == 'merge_group' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) }} uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: @@ -347,8 +343,8 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: components: clippy - # The trusted self-hosted runners keep their build directory and Cargo home instead; the - # untrusted ones (fork pull requests) start empty and restore main's cache, read-only. + # The self-hosted runners keep their build directory and Cargo home instead; everything + # else restores main's cache (read-only off main). - if: needs.changes.outputs.local != 'true' uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: @@ -374,9 +370,9 @@ jobs: # The self-hosted shards (main and the merge queue) build from their warm build directories # instead: downloading the 3 GB archive took them longer than building. if: ${{ !cancelled() && needs.changes.result == 'success' && needs.changes.outputs.native == 'true' && needs.changes.outputs.local != 'true' && (github.event_name != 'pull_request' || needs.checks.result == 'success') }} - runs-on: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && (endsWith(format('{0}', github.event.pull_request.number), '7') || endsWith(format('{0}', github.event.pull_request.number), '8') || endsWith(format('{0}', github.event.pull_request.number), '9'))) && 'self-hosted-untrusted' || 'blacksmith-16vcpu-ubuntu-2404' }} - # Fork builds compile inside gVisor on shared boxes; give them room to finish and upload. - timeout-minutes: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && (endsWith(format('{0}', github.event.pull_request.number), '7') || endsWith(format('{0}', github.event.pull_request.number), '8') || endsWith(format('{0}', github.event.pull_request.number), '9'))) && 90 || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) && 60 || 45 }} + runs-on: blacksmith-16vcpu-ubuntu-2404 + # Fork builds start from main's cache, read-only; give them room to finish and upload. + timeout-minutes: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) && 60 || 45 }} env: CARGO_INCREMENTAL: "0" RUSTC_WRAPPER: sccache @@ -421,7 +417,7 @@ jobs: name: Native Linux tests (${{ matrix.shard }}/4) needs: [changes, checks, build-tests] if: ${{ !cancelled() && needs.changes.outputs.native == 'true' && (github.event_name != 'pull_request' || needs.checks.result == 'success') && (needs.changes.outputs.local == 'true' || needs.build-tests.result == 'success') }} - runs-on: ${{ needs.changes.outputs.local == 'true' && 'self-hosted-fast' || ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && (endsWith(format('{0}', github.event.pull_request.number), '7') || endsWith(format('{0}', github.event.pull_request.number), '8') || endsWith(format('{0}', github.event.pull_request.number), '9'))) && 'self-hosted-untrusted' || 'blacksmith-8vcpu-ubuntu-2404') }} + runs-on: ${{ needs.changes.outputs.local == 'true' && 'self-hosted-fast' || 'blacksmith-8vcpu-ubuntu-2404' }} timeout-minutes: 60 strategy: fail-fast: false @@ -438,7 +434,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install a software Vulkan driver (lavapipe) # Preinstalled on the self-hosted runner, which has no sudo. - if: needs.changes.outputs.local != 'true' && needs.changes.outputs.untrusted != 'true' + if: needs.changes.outputs.local != 'true' run: | sudo apt-get update sudo apt-get install -y --no-install-recommends mesa-vulkan-drivers libvulkan1 @@ -623,8 +619,8 @@ jobs: if: needs.changes.outputs.local == 'true' run: scripts/ci/warm-target.sh doc-tests - uses: dtolnay/rust-toolchain@stable - # The trusted self-hosted runners keep their build directory and Cargo home instead; the - # untrusted ones (fork pull requests) start empty and restore main's cache, read-only. + # The self-hosted runners keep their build directory and Cargo home instead; everything + # else restores main's cache (read-only off main). - if: needs.changes.outputs.local != 'true' uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: @@ -661,7 +657,7 @@ jobs: name: Reference tests needs: changes if: needs.changes.outputs.oracle == 'true' - runs-on: ${{ needs.changes.outputs.local == 'true' && 'self-hosted-fast' || ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && (endsWith(format('{0}', github.event.pull_request.number), '7') || endsWith(format('{0}', github.event.pull_request.number), '8') || endsWith(format('{0}', github.event.pull_request.number), '9'))) && 'self-hosted-untrusted' || 'blacksmith-8vcpu-ubuntu-2404') }} + runs-on: ${{ needs.changes.outputs.local == 'true' && 'self-hosted-fast' || 'blacksmith-8vcpu-ubuntu-2404' }} timeout-minutes: 60 env: CARGO_INCREMENTAL: "0" @@ -676,8 +672,8 @@ jobs: if: needs.changes.outputs.local == 'true' run: scripts/ci/warm-target.sh oracle - uses: dtolnay/rust-toolchain@stable - # The trusted self-hosted runners keep their build directory and Cargo home instead; the - # untrusted ones (fork pull requests) start empty and restore main's cache, read-only. + # The self-hosted runners keep their build directory and Cargo home instead; everything + # else restores main's cache (read-only off main). - if: needs.changes.outputs.local != 'true' uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: