From 07735b2ef662300dcbdde69901143862bc6b5fad Mon Sep 17 00:00:00 2001 From: Tim Morgan Date: Sun, 15 Nov 2026 17:58:15 -0800 Subject: [PATCH] Run macOS CI on Minerva for verified commits A route job from RISCfuture/ci-workflows 1.1.0 sends macOS jobs to Minerva only for verified commits from RISCfuture and keeps the hosted labels for forks, other actors and unverified commits. Each workflow that routes declares the route job with contents: read. Every routed job goes to the macOS 26 pool through the output matching its original label: the Swift 6.4 macos-26 leg of the test matrix, the documentation build in ci.yml, the Pages build in doc.yml, and the Periphery scan, which installs Periphery with Homebrew. The package targets macOS 15, so nothing here needs the macOS 27 pool. The macos-15 and Swift 6.3 legs stay hosted because setup-swift needs sudo for any Swift other than 6.4. The Linux, SwiftLint, swift-format and release jobs are not macOS jobs and are unchanged. In doc.yml the workflow grants only contents: read. The routed build job declares contents: read and the deploy job declares pages: write and id-token: write, so the job that runs on self-hosted hardware holds no Pages or OIDC token. No XCUITestKit workflows are called. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 13 +++++++++++-- .github/workflows/doc.yml | 14 +++++++++++--- .github/workflows/periphery.yml | 7 ++++++- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc143a0..5da4210 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,10 @@ concurrency: cancel-in-progress: true jobs: + route: + uses: RISCfuture/ci-workflows/.github/workflows/minerva-route.yml@1.1.0 + permissions: + contents: read tests: name: Build and Test strategy: @@ -46,7 +50,11 @@ jobs: swift: "6.3" - os: ubuntu-26.04 swift: "6.4" - runs-on: ${{ matrix.os }} + needs: route + # setup-swift needs sudo for Swift versions other than 6.4, so those legs stay hosted + runs-on: >- + ${{ (matrix.os == 'macos-26' || matrix.os == 'macos-latest') && matrix.swift == '6.4' + && fromJSON(needs.route.outputs[matrix.os]) || matrix.os }} steps: - uses: actions/checkout@v7.0.1 - uses: SwiftyLab/setup-swift@v1.14.2 @@ -66,7 +74,8 @@ jobs: run: swift test -v documentation: name: Build Documentation - runs-on: macos-latest + needs: route + runs-on: ${{ fromJSON(needs.route.outputs.macos-latest) }} steps: - uses: actions/checkout@v7.0.1 - uses: SwiftyLab/setup-swift@v1.14.2 diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index f447831..2a91c48 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -7,17 +7,22 @@ on: permissions: contents: read - pages: write - id-token: write concurrency: group: pages cancel-in-progress: true jobs: + route: + uses: RISCfuture/ci-workflows/.github/workflows/minerva-route.yml@1.1.0 + permissions: + contents: read build: name: Generate Documentation - runs-on: macos-latest + needs: route + runs-on: ${{ fromJSON(needs.route.outputs.macos-latest) }} + permissions: + contents: read steps: - uses: actions/checkout@v7.0.1 - uses: SwiftyLab/setup-swift@v1.14.2 @@ -71,6 +76,9 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build + permissions: + pages: write + id-token: write steps: - name: Deploy to GitHub Pages id: deployment diff --git a/.github/workflows/periphery.yml b/.github/workflows/periphery.yml index 42a3a43..9246c93 100644 --- a/.github/workflows/periphery.yml +++ b/.github/workflows/periphery.yml @@ -4,8 +4,13 @@ on: branches: [main] pull_request: jobs: + route: + uses: RISCfuture/ci-workflows/.github/workflows/minerva-route.yml@1.1.0 + permissions: + contents: read periphery: - runs-on: macos-latest + needs: route + runs-on: ${{ fromJSON(needs.route.outputs.macos-latest) }} if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository permissions: contents: read