ci: Convert runner select to composite action (#39270)

to run bencher builds on self-hosted runners (#39269), we will need to
do a self-hosted runner select, but that would exceed the workflow call
depth limit (try → dispatch-workflow → linux → bencher →
self-hosted-runner-select).

this patch converts the self-hosted runner select from a [reusable
workflow](https://docs.github.com/en/actions/concepts/workflows-and-actions/reusable-workflows)
to a [composite
action](https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action),
much like #38503 did for the runner timeout.

Testing:
- self-hosted
<https://github.com/servo/servo/actions/runs/17674919359/job/50235098986>
- GitHub-hosted
<https://github.com/delan/servo/actions/runs/17674928875/job/50234708810>

Fixes: part of #39269

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
shuppy 2025-09-15 12:54:43 +08:00 committed by GitHub
parent eb03fb743c
commit 059a2fd86d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 172 additions and 121 deletions

View file

@ -85,12 +85,29 @@ jobs:
# Runs the underlying job (“workload”) on a self-hosted runner if available,
# with the help of a `runner-select` job and a `runner-timeout` job.
runner-select:
uses: ./.github/workflows/self-hosted-runner-select.yml
secrets: inherit
with:
github-hosted-runner-label: macos-13
self-hosted-image-name: servo-macos13
force-github-hosted-runner: ${{ inputs.force-github-hosted-runner }}
runs-on: ubuntu-22.04
outputs:
unique-id: ${{ steps.select.outputs.unique-id }}
selected-runner-label: ${{ steps.select.outputs.selected-runner-label }}
is-self-hosted: ${{ steps.select.outputs.is-self-hosted }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: '.github'
- name: Runner select
id: select
uses: ./.github/actions/runner-select
with:
monitor-api-token: ${{ secrets.SERVO_CI_MONITOR_API_TOKEN }}
github-hosted-runner-label: macos-13
self-hosted-image-name: servo-macos13
# You can disable self-hosted runners globally by creating a repository variable named
# NO_SELF_HOSTED_RUNNERS with any non-empty value.
# <https://github.com/servo/servo/settings/variables/actions>
NO_SELF_HOSTED_RUNNERS: ${{ vars.NO_SELF_HOSTED_RUNNERS }}
# Any other boolean conditions that disable self-hosted runners go here.
force-github-hosted-runner: ${{ inputs.force-github-hosted-runner }}
runner-timeout:
needs:
- runner-select