mirror of https://github.com/bitcoin/bitcoin.git
ci: add job to determine runner type
To remove multiple occurances of the respository name, against which we compare `${{ github.repository }}` to check if we should use Cirrus Runners, introduce a helper job which can check a single environment variable and output this as an input to subsequent jobs. Forks can maintain a trivial patch of their repo name against the `REPO_USE_CIRRUS_RUNNERS` variable in ci.yml if they have Cirrus Runners of their own, which will then enable cache actions and docker build cache to use Cirrus Cache. It's not possible to use `${{ env.USE_CIRRUS_RUNNERS }}` in the `runs-on:` directive as the context is not supported by GitHub. If it was, this job would no longer be necessary.
This commit is contained in:
parent
020069e6b7
commit
cc1735d777
|
@ -30,6 +30,22 @@ defaults:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
runners:
|
||||||
|
name: 'determine runners'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
use-cirrus-runners: ${{ steps.runners.outputs.use-cirrus-runners }}
|
||||||
|
steps:
|
||||||
|
- id: runners
|
||||||
|
run: |
|
||||||
|
if [[ "${REPO_USE_CIRRUS_RUNNERS}" == "${{ github.repository }}" ]]; then
|
||||||
|
echo "use-cirrus-runners=true" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "::notice title=Runner Selection::Using Cirrus Runners"
|
||||||
|
else
|
||||||
|
echo "use-cirrus-runners=false" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "::notice title=Runner Selection::Using GitHub-hosted runners"
|
||||||
|
fi
|
||||||
|
|
||||||
test-each-commit:
|
test-each-commit:
|
||||||
name: 'test each commit'
|
name: 'test each commit'
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
Loading…
Reference in New Issue