I find myself making pull requests against my fork (mostly on top of #28983), or asking others to do so. Since I don’t want to splurge on a Cirrus account, and since Github free minutes are limited, I looked into how self hosted runners work on Github.
You can see this PR in action on this pull request to my fork: https://github.com/Sjors/bitcoin/actions/runs/7554260507
To test it yourself, spin up one or more self hosted runners (each as its own user), install Docker (maybe in single user mode), and then make a pull request to your own fork, with this PR as the base branch.
Security wise: when dealing with code from strangers on the internet, review it first before running the CI.
This PR also disables Github Actions on forks in order to prevent forks from running out of free minutes (that their owners may need for other projects with much shorter CI runs). This could be made into a separate PR, or dropped altogether.
The first two commits could be split out as well.
TODO:
- deduplicate yaml (can’t use anchors https://github.com/actions/runner/issues/1182)
- add macOS native worker
- add Windows native worker (I can’t easily test this myself, so might leave it followup)
- prevent self hosted jobs from cluttering UI on the main
- check behaviour against the gui repo
- make resource consumption configurable (some function of nproc? or configured locally on the workers?)
- documentation
Related: I wrote a gist for how to run CI on Ubuntu desktop with one runner per window. The windows close if the run is successful so you can inspect the ones that fail. But I find using Github’s CI web interface a bit more convenient, hence this PR.