Skip to content

Commit 55a0d0d

Browse files
committed
ci: split out multiprocess linting to a separate step on Actions
1 parent 0f17388 commit 55a0d0d

File tree

3 files changed

+44
-18
lines changed

3 files changed

+44
-18
lines changed

.github/workflows/build-src.yml

+8
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ jobs:
8787
ccache -c
8888
shell: bash
8989

90+
- name: Run linters
91+
if: inputs.build-target == 'linux64_multiprocess'
92+
run: |
93+
export BUILD_TARGET="${{ inputs.build-target }}"
94+
source ./ci/dash/matrix.sh
95+
./ci/dash/lint-tidy.sh
96+
shell: bash
97+
9098
- name: Run unit tests
9199
run: |
92100
BASE_OUTDIR="/output"

ci/dash/build_src.sh

+7-18
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ set -e
1111

1212
source ./ci/dash/matrix.sh
1313

14-
unset CC; unset CXX
15-
unset DISPLAY
14+
unset CC CXX DISPLAY;
1615

1716
if [ "$PULL_REQUEST" != "false" ]; then test/lint/commit-script-check.sh $COMMIT_RANGE; fi
1817

@@ -51,6 +50,8 @@ make distdir VERSION=$BUILD_TARGET
5150
cd dashcore-$BUILD_TARGET
5251
bash -c "./configure $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG" || ( cat config.log && false)
5352

53+
# This step influences compilation and therefore will always be a part of the
54+
# compile step
5455
if [ "${RUN_TIDY}" = "true" ]; then
5556
MAYBE_BEAR="bear --config src/.bear-tidy-config"
5657
MAYBE_TOKEN="--"
@@ -65,22 +66,10 @@ if [ -n "$USE_VALGRIND" ]; then
6566
${BASE_ROOT_DIR}/ci/test/wrap-valgrind.sh
6667
fi
6768

68-
if [ "${RUN_TIDY}" = "true" ]; then
69-
set -eo pipefail
70-
cd src
71-
( run-clang-tidy -quiet "${MAKEJOBS}" ) | grep -C5 "error"
72-
cd ..
73-
iwyu_tool.py \
74-
"src/compat" \
75-
"src/init" \
76-
"src/rpc/fees.cpp" \
77-
"src/rpc/signmessage.cpp" \
78-
-p . "${MAKEJOBS}" \
79-
-- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \
80-
2>&1 | tee "/tmp/iwyu_ci.out"
81-
cd src
82-
fix_includes.py --nosafe_headers < /tmp/iwyu_ci.out
83-
git --no-pager diff
69+
# GitHub Actions can segment a job into steps, linting is a separate step
70+
# so Actions runners will perform this step separately.
71+
if [ "${RUN_TIDY}" = "true" ] && [ "${GITHUB_ACTIONS}" != "true" ]; then
72+
${BASE_ROOT_DIR}/ci/dash/lint-tidy.sh
8473
fi
8574

8675
if [ "$RUN_SECURITY_TESTS" = "true" ]; then

ci/dash/lint-tidy.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 The Dash Core developers
3+
# Distributed under the MIT software license, see the accompanying
4+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5+
6+
export LC_ALL=C.UTF-8
7+
8+
set -eo pipefail
9+
10+
# Warning: This script does not generate the compilation database these linters rely
11+
# only on nor do they set the requisite build parameters. Make sure you do
12+
# that *before* running this script.
13+
14+
cd "${BASE_ROOT_DIR}/build-ci/dashcore-${BUILD_TARGET}/src"
15+
( run-clang-tidy -quiet "${MAKEJOBS}" ) | grep -C5 "error"
16+
17+
cd "${BASE_ROOT_DIR}/build-ci/dashcore-${BUILD_TARGET}"
18+
iwyu_tool.py \
19+
"src/compat" \
20+
"src/init" \
21+
"src/rpc/fees.cpp" \
22+
"src/rpc/signmessage.cpp" \
23+
-p . "${MAKEJOBS}" \
24+
-- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \
25+
2>&1 | tee "/tmp/iwyu_ci.out"
26+
27+
cd "${BASE_ROOT_DIR}/build-ci/dashcore-${BUILD_TARGET}/src"
28+
fix_includes.py --nosafe_headers < /tmp/iwyu_ci.out
29+
git --no-pager diff

0 commit comments

Comments
 (0)