Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
42 changes: 34 additions & 8 deletions depend/bitcoin/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ defaults:

jobs:
runners:
name: 'determine runners'
name: '[meta] determine runners'
runs-on: ubuntu-latest
outputs:
provider: ${{ steps.runners.outputs.provider }}
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Determine fetch depth
run: echo "FETCH_DEPTH=$((${{ github.event.pull_request.commits }} + 2))" >> "$GITHUB_ENV"
- *ANNOTATION_PR_NUMBER
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: ${{ env.FETCH_DEPTH }}
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:

- &CHECKOUT
name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
# Ensure the latest merged pull request state is used, even on re-runs.
ref: &CHECKOUT_REF_TMPL ${{ github.event_name == 'pull_request' && github.ref || '' }}
Expand Down Expand Up @@ -343,9 +343,23 @@ jobs:
run: |
py -3 test/fuzz/test_runner.py --par $NUMBER_OF_PROCESSORS --loglevel DEBUG "${RUNNER_TEMP}/qa-assets/fuzz_corpora"

record-frozen-commit:
# Record frozen commit, so that the native tests on cross-builds can run on
# the exact same commit id of the build.
name: '[meta] record frozen commit'
runs-on: ubuntu-latest
outputs:
commit: ${{ steps.record-commit.outputs.commit }}
steps:
- *ANNOTATION_PR_NUMBER
- *CHECKOUT
- name: Record commit
id: record-commit
run: echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"

windows-cross:
name: 'Windows-cross to x86_64, ${{ matrix.crt }}'
needs: runners
needs: [runners, record-frozen-commit]
runs-on: ${{ needs.runners.outputs.provider == 'cirrus' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm' || 'ubuntu-24.04' }}
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}

Expand All @@ -368,7 +382,10 @@ jobs:
steps:
- *ANNOTATION_PR_NUMBER

- *CHECKOUT
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ needs.record-frozen-commit.outputs.commit }}

- name: Configure environment
uses: ./.github/actions/configure-environment
Expand Down Expand Up @@ -402,7 +419,7 @@ jobs:
windows-native-test:
name: 'Windows, ${{ matrix.crt }}, test cross-built'
runs-on: windows-2022
needs: windows-cross
needs: [windows-cross, record-frozen-commit]

strategy:
fail-fast: false
Expand All @@ -421,7 +438,10 @@ jobs:
steps:
- *ANNOTATION_PR_NUMBER

- *CHECKOUT
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ needs.record-frozen-commit.outputs.commit }}

- name: Download built executables
uses: actions/download-artifact@v5
Expand Down Expand Up @@ -502,6 +522,12 @@ jobs:
fail-fast: false
matrix:
include:
- name: 'iwyu'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
file-env: './ci/test/00_setup_env_native_iwyu.sh'

- name: '32 bit ARM'
cirrus-runner: 'ubuntu-24.04-arm' # Cirrus' Arm runners are Apple (with virtual Linux aarch64), which doesn't support 32-bit mode
fallback-runner: 'ubuntu-24.04-arm'
Expand Down Expand Up @@ -637,7 +663,7 @@ jobs:
- *ANNOTATION_PR_NUMBER

- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
ref: *CHECKOUT_REF_TMPL
fetch-depth: 0
Expand Down
1 change: 1 addition & 0 deletions depend/bitcoin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

# Only ignore unexpected patches
*.patch
!ci/test/*.patch
!contrib/guix/patches/*.patch
!depends/patches/**/*.patch

Expand Down
1 change: 0 additions & 1 deletion depend/bitcoin/ci/lint/01_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ command -v python3
python3 --version

${CI_RETRY_EXE} pip3 install \
codespell==2.4.1 \
lief==0.16.6 \
mypy==1.18.2 \
pyzmq==27.1.0 \
Expand Down
25 changes: 25 additions & 0 deletions depend/bitcoin/ci/test/00_setup_env_native_iwyu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
#
# Copyright (c) 2023-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

export LC_ALL=C.UTF-8

export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" # To build codegen, CMake must be 3.31 or newer.
export CONTAINER_NAME=ci_native_iwyu
export TIDY_LLVM_V="21"
export APT_LLVM_V="${TIDY_LLVM_V}"
export PACKAGES="clang-${TIDY_LLVM_V} clang-format-${TIDY_LLVM_V} libclang-${TIDY_LLVM_V}-dev llvm-${TIDY_LLVM_V}-dev jq libevent-dev libboost-dev libzmq3-dev systemtap-sdt-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev libsqlite3-dev libcapnp-dev capnproto"
export NO_DEPENDS=1
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
export RUN_FUZZ_TESTS=false
export RUN_CHECK_DEPS=false
export RUN_IWYU=true
export GOAL="codegen"
export BITCOIN_CONFIG="\
--preset dev-mode -DBUILD_GUI=OFF \
-DCMAKE_C_COMPILER=clang-${TIDY_LLVM_V} \
-DCMAKE_CXX_COMPILER=clang++-${TIDY_LLVM_V} \
"
3 changes: 2 additions & 1 deletion depend/bitcoin/ci/test/01_base_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ if [[ -n "${USE_INSTRUMENTED_LIBCPP}" ]]; then
rm -rf /llvm-project
fi

if [[ "${RUN_TIDY}" == "true" ]]; then
if [[ "${RUN_IWYU}" == true ]]; then
${CI_RETRY_EXE} git clone --depth=1 https://github.com/include-what-you-use/include-what-you-use -b clang_"${TIDY_LLVM_V}" /include-what-you-use
(cd /include-what-you-use && patch -p1 < /ci_container_base/ci/test/01_iwyu.patch)
cmake -B /iwyu-build/ -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-"${TIDY_LLVM_V}" -S /include-what-you-use
make -C /iwyu-build/ install "$MAKEJOBS"
fi
Expand Down
Loading
Loading