11name : Select Self-hosted Runner
22inputs :
3+ forge-is-forgejo :
4+ required : true
5+ type : boolean
6+ queue-api-base-url :
7+ required : true
8+ type : string
39 GITHUB_TOKEN :
410 required : true
511 type : string
4147
4248 set -euo pipefail
4349
50+ apt_install() {
51+ # Install distro packages, but only if one or more are not already installed.
52+ # Update the package lists first, to avoid failures when rebaking old images.
53+ if ! dpkg -s "$@" > /dev/null 2>&1; then
54+ apt update
55+ # DEBIAN_FRONTEND needed to avoid hang when installing tshark
56+ DEBIAN_FRONTEND=noninteractive apt install -y "$@"
57+ fi
58+ }
59+
60+ # Already installed on GitHub ubuntu-24.04, but not Codeberg codeberg-tiny.
61+ apt_install uuid-runtime
62+
4463 # Generate a unique id that allows the workload job to find the runner
4564 # we are reserving for it (via runner labels), and allows the timeout
4665 # job to find the workload job run (via the job’s friendly name), even
7897 - id : artifact
7998 name : Publish artifact with args
8099 if : ${{ !fromJSON(steps.init.outputs.disabled) }}
81- uses : actions/upload-artifact@v4
100+ uses : ${{ inputs.forge-is-forgejo && 'forgejo/upload-artifact@v4' || ' actions/upload-artifact@v4' }}
82101 with :
83102 name : servo-ci-runners_${{ steps.init.outputs.unique_id }}
84103 path : ${{ steps.init.outputs.artifact_path }}
88107 name : Find a server and reserve a runner
89108 shell : bash
90109 run : |
110+ queue_api_base_url='${{ inputs.queue-api-base-url }}'
91111 github_hosted_runner_label='${{ inputs.github-hosted-runner-label }}'
92112 self_hosted_image_name='${{ inputs.self-hosted-image-name }}'
93113 disabled='${{ steps.init.outputs.disabled }}'
@@ -107,7 +127,6 @@ runs:
107127 fall_back_to_github_hosted
108128 fi
109129
110- queue_api_base_url=https://ci0.servo.org/queue
111130 # Use the queue API to enqueue this job.
112131 enqueue_url=$queue_api_base_url/enqueue\?unique_id=$unique_id\&qualified_repo=${{ github.repository }}\&run_id=${{ github.run_id }}
113132 result=$(mktemp)
0 commit comments