msys2 / msys2-autobuild

🏭🏭🏭🏭🏭🏭🏭🏭
https://packages.msys2.org/queue
MIT License
35 stars 25 forks source link

Use labels to restrict self-hosted runner selection. #56

Closed jeremyd2019 closed 2 years ago

jeremyd2019 commented 2 years ago

For reasons of GitHub's API permissions, I prefer to use organization-scoped self-hosted runners rather than repository-scoped (organizations have a self-hosted runner permission, but repositories need repository admin to manage self-hosted runners). This results in the same pool of runners being shared between msys2-autobuild and MINGW-packages (or other repositories in the msys2-arm organization). I've found, though, that I prefer not to run MINGW-packages workflows on the same self-hosted runner as autobuild (since I don't trust it as much not to mess up the install somehow, and I'm dealing with persistent runners). I currently enforce this by manually shutting down autobuild's workflow and the runner I use for autobuild before starting any MINGW-packages workflows. This could be handled automatically by adding "autobuild" and "CI" labels to the runners, and adding those labels to the list of labels used to select the self-hosted runner for a job.

This commit does this for autobuild, restricting the runner selection to a runner which has Windows, ARM64, and now autobuild labels.

(This also seems like a situation that "runner groups" could have solved, but Github seems to only let paying organizations create those).