From e084cb8552187fe16cba0dd0ef4493e62e46876f Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 22 Nov 2026 00:03:23 -0500 Subject: [PATCH] ci: use artcraft-k8s-trusted runner on main (#16368) * ci: use artcraft-k8s-trusted runner on main * ci: sccache on main runs, which use the shared cluster cache on the trusted runners --------- Co-authored-by: aiongg --- .github/workflows/cache-prune.yml | 2 +- .github/workflows/ci.yml | 26 +++++++++++++++----------- .github/workflows/docs.yml | 1 + .github/workflows/packaging-lint.yml | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cache-prune.yml b/.github/workflows/cache-prune.yml index cc71a9c4f1a..7607488502f 100644 --- a/.github/workflows/cache-prune.yml +++ b/.github/workflows/cache-prune.yml @@ -21,7 +21,7 @@ jobs: # A fork's pull request from a branch named main also matches `branches`. if: github.event.workflow_run.event != 'pull_request' timeout-minutes: 10 - runs-on: ubuntu-24.04 + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-24.04' }} permissions: actions: write steps: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0baaa06b080..12d34acb619 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,7 +93,7 @@ jobs: if: github.event_name != 'schedule' && (github.event.action != 'labeled' || github.event.label.name == 'full-ci') timeout-minutes: 10 name: select platforms - runs-on: ubuntu-latest + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-latest' }} outputs: windows: ${{ steps.pick.outputs.windows }} windows_gpu: ${{ steps.pick.outputs.windows_gpu }} @@ -167,6 +167,10 @@ jobs: # Tracks @main so suite-wide CI fixes reach every app without a PR in each repository. uses: storytold/craft-common-actions/.github/workflows/gate.yml@main with: + os: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && '["artcraft-k8s-trusted"]' || '["ubuntu-24.04"]' }} + # On the cluster runners sccache uses the shared cluster cache, which main runs fill for + # every app; PR runs on hosted runners can't reach it, so they leave it off. + sccache: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} # egui/winit/rfd. packages: >- libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev @@ -264,7 +268,7 @@ jobs: # A cold Windows build takes about an hour, and the watch ends when it does; `watch-minutes` # ends it before this limit. timeout-minutes: 120 - runs-on: ubuntu-24.04 + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-24.04' }} permissions: actions: write steps: @@ -295,7 +299,7 @@ jobs: timeout-minutes: 60 name: test (without heif) # The gate's runner: its cache entry is keyed on the OS. - runs-on: ubuntu-24.04 + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-24.04' }} env: # The gate sets these; rust-cache hashes CARGO_* and RUST* variables into its key. CARGO_INCREMENTAL: 0 @@ -352,7 +356,7 @@ jobs: # restore and a download; a missing corpus fails the tests. The cache key changes only when a # pin or manifest does, so normally this restores in seconds (fork PRs read the base cache). name: corpus tests - runs-on: ubuntu-latest + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-latest' }} env: # test-corpus builds with --release, but here without the release profile's thin LTO and # single codegen unit: they ran LTO over the dependency graph for each of the ~95 corpus test @@ -393,7 +397,7 @@ jobs: # PRs run it only when web-relevant files change (see `platforms`); main always does. needs: platforms if: needs.platforms.outputs.web == 'true' - runs-on: ubuntu-latest + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-latest' }} env: # Match release.yml so PR results reflect what would actually ship. TRUNK_VERSION: 0.21.14 @@ -458,7 +462,7 @@ jobs: name: fuzz (${{ matrix.target.crate }}/${{ matrix.target.name }}) # Placeholder: manual trigger only until a nightly schedule is enabled. if: github.event_name == 'workflow_dispatch' && inputs.fuzz - runs-on: ubuntu-latest + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-latest' }} strategy: fail-fast: false matrix: @@ -512,7 +516,7 @@ jobs: color-range-performance: if: inputs.color_range == true - runs-on: ubuntu-latest + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-latest' }} timeout-minutes: 45 env: RAYON_NUM_THREADS: "4" @@ -545,7 +549,7 @@ jobs: selection-morphology: if: inputs.selection_morphology == true - runs-on: ubuntu-latest + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-latest' }} timeout-minutes: 45 env: RAYON_NUM_THREADS: "4" @@ -616,7 +620,7 @@ jobs: selection-combining: if: inputs.selection_combining == true - runs-on: ubuntu-latest + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-latest' }} timeout-minutes: 30 env: RAYON_NUM_THREADS: "4" @@ -643,7 +647,7 @@ jobs: brush-tip: if: inputs.brush_tip == true - runs-on: ubuntu-24.04 + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-24.04' }} timeout-minutes: 30 env: RAYON_NUM_THREADS: "4" @@ -687,7 +691,7 @@ jobs: path: brush-tip.txt dry-mixer: if: inputs.dry_mixer == true - runs-on: ubuntu-latest + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-latest' }} timeout-minutes: 90 env: RAYON_NUM_THREADS: "4" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2edb7a39312..d567f2c2c08 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -31,6 +31,7 @@ jobs: # Tracks @main so suite-wide CI fixes reach every app without a PR in each repository. uses: storytold/craft-common-actions/.github/workflows/gate.yml@main with: + os: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && '["artcraft-k8s-trusted"]' || '["ubuntu-24.04"]' }} timeout-minutes: 15 # The book needs mdBook only: no craft-fonts, apt packages, wasm target or nextest. craft-fonts-ref: "" diff --git a/.github/workflows/packaging-lint.yml b/.github/workflows/packaging-lint.yml index 980c3a24454..a1a514af5a6 100644 --- a/.github/workflows/packaging-lint.yml +++ b/.github/workflows/packaging-lint.yml @@ -27,7 +27,7 @@ jobs: verified-appimage-inputs: timeout-minutes: 10 name: Verified AppImage inputs - runs-on: ubuntu-latest + runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-trusted' || 'ubuntu-latest' }} steps: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4