Skip to content

Commit 3b3ab3a

Browse files
committed
Merge bitcoin/bitcoin#33302: ci: disable cirrus cache in 32bit arm job
00c253d ci: disable cirrus cache in 32bit arm job (will) ff18b6b ci: refactor docker action to return provider str (will) Pull request description: Add an optional matrix field allowing opt-out of configuring cirrus GHA cache when not using cirrus runners. This is not needed for the cirruslabs/[save|restore]-cache actions, as they automatically fallback based on runner type. Addresses bitcoin/bitcoin#31965 (comment) ACKs for top commit: m3dwards: ACK 00c253d Tree-SHA512: 4c79deec2b0018f62a982b2d1051c78e94e242a1b8faf5db037353b05b707827dafded56c9b5ffbc861fcadac5a90571077e6ab69410975f7a2f40c755630a8e
2 parents 34fefb6 + 00c253d commit 3b3ab3a

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

.github/actions/configure-docker/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: 'Configure Docker'
22
description: 'Set up Docker build driver and configure build cache args'
33
inputs:
4-
use-cirrus:
5-
description: 'Use cirrus cache'
4+
cache-provider:
5+
description: 'gha or cirrus cache provider'
66
required: true
7+
options:
8+
- gh
9+
- cirrus
710
runs:
811
using: 'composite'
912
steps:
@@ -32,7 +35,7 @@ runs:
3235
# which are set automatically when running on GitHub infra: https://docs.docker.com/build/cache/backends/gha/#synopsis
3336
3437
# Use cirrus cache host
35-
if [[ ${{ inputs.use-cirrus }} == 'true' ]]; then
38+
if [[ ${{ inputs.cache-provider }} == 'cirrus' ]]; then
3639
url_args="url=${CIRRUS_CACHE_HOST},url_v2=${CIRRUS_CACHE_HOST}"
3740
else
3841
url_args=""

.github/workflows/ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ jobs:
3333
name: 'determine runners'
3434
runs-on: ubuntu-latest
3535
outputs:
36-
use-cirrus-runners: ${{ steps.runners.outputs.use-cirrus-runners }}
36+
provider: ${{ steps.runners.outputs.provider }}
3737
steps:
3838
- id: runners
3939
run: |
4040
if [[ "${REPO_USE_CIRRUS_RUNNERS}" == "${{ github.repository }}" ]]; then
41-
echo "use-cirrus-runners=true" >> "$GITHUB_OUTPUT"
41+
echo "provider=cirrus" >> "$GITHUB_OUTPUT"
4242
echo "::notice title=Runner Selection::Using Cirrus Runners"
4343
else
44-
echo "use-cirrus-runners=false" >> "$GITHUB_OUTPUT"
44+
echo "provider=gha" >> "$GITHUB_OUTPUT"
4545
echo "::notice title=Runner Selection::Using GitHub-hosted runners"
4646
fi
4747
@@ -312,7 +312,7 @@ jobs:
312312
windows-cross:
313313
name: 'Linux->Windows cross, no tests'
314314
needs: runners
315-
runs-on: ${{ needs.runners.outputs.use-cirrus-runners == 'true' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm' || 'ubuntu-24.04' }}
315+
runs-on: ${{ needs.runners.outputs.provider == 'cirrus' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm' || 'ubuntu-24.04' }}
316316
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
317317

318318
env:
@@ -332,7 +332,7 @@ jobs:
332332
- name: Configure Docker
333333
uses: ./.github/actions/configure-docker
334334
with:
335-
use-cirrus: ${{ needs.runners.outputs.use-cirrus-runners }}
335+
cache-provider: ${{ needs.runners.outputs.provider }}
336336

337337
- name: CI script
338338
run: ./ci/test_run_all.sh
@@ -422,7 +422,7 @@ jobs:
422422
ci-matrix:
423423
name: ${{ matrix.name }}
424424
needs: runners
425-
runs-on: ${{ needs.runners.outputs.use-cirrus-runners == 'true' && matrix.cirrus-runner || matrix.fallback-runner }}
425+
runs-on: ${{ needs.runners.outputs.provider == 'cirrus' && matrix.cirrus-runner || matrix.fallback-runner }}
426426
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
427427
timeout-minutes: ${{ matrix.timeout-minutes }}
428428

@@ -439,6 +439,7 @@ jobs:
439439
fallback-runner: 'ubuntu-24.04-arm'
440440
timeout-minutes: 120
441441
file-env: './ci/test/00_setup_env_arm.sh'
442+
provider: 'gha'
442443

443444
- name: 'ASan + LSan + UBSan + integer, no depends, USDT'
444445
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools
@@ -513,7 +514,7 @@ jobs:
513514
- name: Configure Docker
514515
uses: ./.github/actions/configure-docker
515516
with:
516-
use-cirrus: ${{ needs.runners.outputs.use-cirrus-runners }}
517+
cache-provider: ${{ matrix.provider || needs.runners.outputs.provider }}
517518

518519
- name: Enable bpfcc script
519520
if: ${{ env.CONTAINER_NAME == 'ci_native_asan' }}
@@ -550,7 +551,7 @@ jobs:
550551
- name: Configure Docker
551552
uses: ./.github/actions/configure-docker
552553
with:
553-
use-cirrus: ${{ needs.runners.outputs.use-cirrus-runners }}
554+
cache-provider: ${{ needs.runners.outputs.provider }}
554555

555556
- name: CI script
556557
run: |

0 commit comments

Comments
 (0)