Skip to content

Commit 88b8e88

Browse files
authored
Merge branch 'bitcoin:master' into interface-load-snapshot
2 parents 8bc4035 + 2d6a0c4 commit 88b8e88

File tree

553 files changed

+20982
-37128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

553 files changed

+20982
-37128
lines changed

.cirrus.yml

Lines changed: 0 additions & 199 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 'Configure Docker'
2+
description: 'Set up Docker build driver and configure build cache args'
3+
inputs:
4+
use-cirrus:
5+
description: 'Use cirrus cache'
6+
required: true
7+
runs:
8+
using: 'composite'
9+
steps:
10+
- name: Set up Docker Buildx
11+
uses: docker/setup-buildx-action@v3
12+
with:
13+
# Use host network to allow access to cirrus gha cache running on the host
14+
driver-opts: |
15+
network=host
16+
17+
# This is required to allow buildkit to access the actions cache
18+
- name: Expose actions cache variables
19+
uses: actions/github-script@v6
20+
with:
21+
script: |
22+
core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL'])
23+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env['ACTIONS_RUNTIME_TOKEN'])
24+
25+
- name: Construct docker build cache args
26+
shell: bash
27+
run: |
28+
# Configure docker build cache backend
29+
#
30+
# On forks the gha cache will work but will use Github's cache backend.
31+
# Docker will check for variables $ACTIONS_CACHE_URL, $ACTIONS_RESULTS_URL and $ACTIONS_RUNTIME_TOKEN
32+
# which are set automatically when running on GitHub infra: https://docs.docker.com/build/cache/backends/gha/#synopsis
33+
34+
# Use cirrus cache host
35+
if [[ ${{ inputs.use-cirrus }} == 'true' ]]; then
36+
url_args="url=${CIRRUS_CACHE_HOST},url_v2=${CIRRUS_CACHE_HOST}"
37+
else
38+
url_args=""
39+
fi
40+
41+
# Always optimistically --cache‑from in case a cache blob exists
42+
args=(--cache-from "type=gha${url_args:+,${url_args}},scope=${CONTAINER_NAME}")
43+
44+
# If this is a push to the default branch, also add --cache‑to to save the cache
45+
if [[ ${{ github.event_name }} == "push" && ${{ github.ref_name }} == ${{ github.event.repository.default_branch }} ]]; then
46+
args+=(--cache-to "type=gha${url_args:+,${url_args}},mode=max,ignore-error=true,scope=${CONTAINER_NAME}")
47+
fi
48+
49+
# Always `--load` into docker images (needed when using the `docker-container` build driver).
50+
args+=(--load)
51+
52+
echo "DOCKER_BUILD_CACHE_ARG=${args[*]}" >> $GITHUB_ENV
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Configure environment'
2+
description: 'Configure CI, cache and container name environment variables'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Set CI and cache directories
7+
shell: bash
8+
run: |
9+
echo "BASE_ROOT_DIR=${{ runner.temp }}" >> "$GITHUB_ENV"
10+
echo "BASE_BUILD_DIR=${{ runner.temp }}/build" >> "$GITHUB_ENV"
11+
echo "CCACHE_DIR=${{ runner.temp }}/ccache_dir" >> $GITHUB_ENV
12+
echo "DEPENDS_DIR=${{ runner.temp }}/depends" >> "$GITHUB_ENV"
13+
echo "BASE_CACHE=${{ runner.temp }}/depends/built" >> $GITHUB_ENV
14+
echo "SOURCES_PATH=${{ runner.temp }}/depends/sources" >> $GITHUB_ENV
15+
echo "PREVIOUS_RELEASES_DIR=${{ runner.temp }}/previous_releases" >> $GITHUB_ENV
16+
17+
- name: Set cache hashes
18+
shell: bash
19+
run: |
20+
echo "DEPENDS_HASH=$(git ls-tree HEAD depends "ci/test/$FILE_ENV" | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
21+
echo "PREVIOUS_RELEASES_HASH=$(git ls-tree HEAD test/get_previous_releases.py | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
22+
23+
- name: Get container name
24+
shell: bash
25+
run: |
26+
source $FILE_ENV
27+
echo "CONTAINER_NAME=$CONTAINER_NAME" >> "$GITHUB_ENV"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: 'Restore Caches'
2+
description: 'Restore ccache, depends sources, and built depends caches'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Restore Ccache cache
7+
id: ccache-cache
8+
uses: cirruslabs/cache/restore@v4
9+
with:
10+
path: ${{ env.CCACHE_DIR }}
11+
key: ccache-${{ env.CONTAINER_NAME }}-${{ github.run_id }}
12+
restore-keys: |
13+
ccache-${{ env.CONTAINER_NAME }}-
14+
15+
- name: Restore depends sources cache
16+
id: depends-sources
17+
uses: cirruslabs/cache/restore@v4
18+
with:
19+
path: ${{ env.SOURCES_PATH }}
20+
key: depends-sources-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
21+
restore-keys: |
22+
depends-sources-${{ env.CONTAINER_NAME }}-
23+
24+
- name: Restore built depends cache
25+
id: depends-built
26+
uses: cirruslabs/cache/restore@v4
27+
with:
28+
path: ${{ env.BASE_CACHE }}
29+
key: depends-built-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
30+
restore-keys: |
31+
depends-built-${{ env.CONTAINER_NAME }}-
32+
33+
- name: Restore previous releases cache
34+
id: previous-releases
35+
uses: cirruslabs/cache/restore@v4
36+
with:
37+
path: ${{ env.PREVIOUS_RELEASES_DIR }}
38+
key: previous-releases-${{ env.CONTAINER_NAME }}-${{ env.PREVIOUS_RELEASES_HASH }}
39+
restore-keys: |
40+
previous-releases-${{ env.CONTAINER_NAME }}-
41+
42+
- name: export cache hits
43+
shell: bash
44+
run: |
45+
echo "depends-sources-cache-hit=${{ steps.depends-sources.outputs.cache-hit }}" >> $GITHUB_ENV
46+
echo "depends-built-cache-hit=${{ steps.depends-built.outputs.cache-hit }}" >> $GITHUB_ENV
47+
echo "previous-releases-cache-hit=${{ steps.previous-releases.outputs.cache-hit }}" >> $GITHUB_ENV
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 'Save Caches'
2+
description: 'Save ccache, depends sources, and built depends caches'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: debug cache hit inputs
7+
shell: bash
8+
run: |
9+
echo "depends sources direct cache hit to primary key: ${{ env.depends-sources-cache-hit }}"
10+
echo "depends built direct cache hit to primary key: ${{ env.depends-built-cache-hit }}"
11+
echo "previous releases direct cache hit to primary key: ${{ env.previous-releases-cache-hit }}"
12+
13+
- name: Save Ccache cache
14+
uses: cirruslabs/cache/save@v4
15+
if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) }}
16+
with:
17+
path: ${{ env.CCACHE_DIR }}
18+
key: ccache-${{ env.CONTAINER_NAME }}-${{ github.run_id }}
19+
20+
- name: Save depends sources cache
21+
uses: cirruslabs/cache/save@v4
22+
if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) && (env.depends-sources-cache-hit != 'true') }}
23+
with:
24+
path: ${{ env.SOURCES_PATH }}
25+
key: depends-sources-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
26+
27+
- name: Save built depends cache
28+
uses: cirruslabs/cache/save@v4
29+
if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) && (env.depends-built-cache-hit != 'true' )}}
30+
with:
31+
path: ${{ env.BASE_CACHE }}
32+
key: depends-built-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
33+
34+
- name: Save previous releases cache
35+
uses: cirruslabs/cache/save@v4
36+
if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) && (env.previous-releases-cache-hit != 'true' )}}
37+
with:
38+
path: ${{ env.PREVIOUS_RELEASES_DIR }}
39+
key: previous-releases-${{ env.CONTAINER_NAME }}-${{ env.PREVIOUS_RELEASES_HASH }}

0 commit comments

Comments
 (0)