Skip to content

Commit b34d49a

Browse files
committed
Merge bitcoin#32203: ci: Merge master in test-each-commit task
faa807b ci: Merge master in test-each-commit task (MarcoFalke) Pull request description: The `test-each-commit` task will often fail, when the CI config yaml is updated along with code changes. This is because, GitHub seems to be merging the CI config on a fresh pull with the current target branch (`master`). However, the code changes are not. A tedious workaround would be for every developer to rebase on every intermittent (bitcoin#31946 (comment)) and non-intermittent CI issue. However, fix this instead by merging with `master`. ACKs for top commit: laanwj: ACK faa807b hebasto: ACK faa807b. Tree-SHA512: 4849bd558dc6cdc7d86b95164ccee32ab7c08c9b7d31cf8ec5c8e9a2251fc819630f8fa9b929ed39e8e033c67bb006f0beb33e0de216e1224680be88c5fa0161
2 parents c66f7da + faa807b commit b34d49a

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/ci-test-each-commit-exec.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
7+
export LC_ALL=C.UTF-8
8+
9+
set -o errexit -o pipefail -o xtrace
10+
11+
12+
echo "Running test-one-commit on $( git log -1 )"
13+
14+
git config user.email "ci@example.com"
15+
git config user.name "CI"
16+
git merge --no-commit origin/master
17+
18+
# Use clang++, because it is a bit faster and uses less memory than g++
19+
CC=clang CXX=clang++ cmake -B build -DWERROR=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWITH_BDB=ON -DWITH_USDT=ON -DCMAKE_CXX_FLAGS='-Wno-error=unused-member-function'
20+
21+
cmake --build build -j "$( nproc )" && ctest --output-on-failure --stop-on-failure --test-dir build -j "$( nproc )"
22+
23+
./build/test/functional/test_runner.py -j $(( $(nproc) * 2 )) --combinedlogslen=99999999
24+
25+
git merge --abort

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,15 @@ jobs:
7171
EXCLUDE_MERGE_BASE_ANCESTORS=^${MERGE_BASE}^@
7272
fi
7373
echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD $EXCLUDE_MERGE_BASE_ANCESTORS | head -1)" >> "$GITHUB_ENV"
74+
- run: |
75+
git fetch origin master
7476
- run: |
7577
sudo apt-get update
7678
sudo apt-get install clang ccache build-essential cmake ninja-build pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libzmq3-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev -y
7779
- name: Compile and run tests
7880
run: |
7981
# Run tests on commits after the last merge commit and before the PR head commit
80-
# Use clang++, because it is a bit faster and uses less memory than g++
81-
git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && CC=clang CXX=clang++ cmake -B build -DWERROR=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWITH_BDB=ON -DWITH_USDT=ON -DCMAKE_CXX_FLAGS='-Wno-error=unused-member-function' && cmake --build build -j $(nproc) && ctest --output-on-failure --stop-on-failure --test-dir build -j $(nproc) && ./build/test/functional/test_runner.py -j $(( $(nproc) * 2 )) --combinedlogslen=99999999" ${{ env.TEST_BASE }}
82+
git rebase --exec "./.github/ci-test-each-commit-exec.sh" ${{ env.TEST_BASE }}
8283
8384
macos-native-arm64:
8485
name: ${{ matrix.job-name }}

0 commit comments

Comments
 (0)