Skip to content

Commit fa847ed

Browse files
author
MacroFake
committed
ci: Clone iwyu only if missing
1 parent 26296eb commit fa847ed

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ci/test/04_install.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,13 @@ if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
112112
fi
113113

114114
if [[ "${RUN_TIDY}" == "true" ]]; then
115-
CI_EXEC "mkdir -p ${BASE_SCRATCH_DIR}/iwyu/build/"
116-
CI_EXEC "git clone --depth=1 https://github.com/include-what-you-use/include-what-you-use -b clang_14 ${BASE_SCRATCH_DIR}/iwyu/include-what-you-use"
117-
CI_EXEC "cd ${BASE_SCRATCH_DIR}/iwyu/build && cmake -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-14 ../include-what-you-use"
118-
CI_EXEC "cd ${BASE_SCRATCH_DIR}/iwyu/build && make install $MAKEJOBS"
115+
export DIR_IWYU="${BASE_SCRATCH_DIR}/iwyu"
116+
if [ ! -d "${DIR_IWYU}" ]; then
117+
CI_EXEC "mkdir -p ${DIR_IWYU}/build/"
118+
CI_EXEC "git clone --depth=1 https://github.com/include-what-you-use/include-what-you-use -b clang_14 ${DIR_IWYU}/include-what-you-use"
119+
CI_EXEC "cd ${DIR_IWYU}/build && cmake -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-14 ../include-what-you-use"
120+
CI_EXEC "cd ${DIR_IWYU}/build && make install $MAKEJOBS"
121+
fi
119122
fi
120123

121124
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then

ci/test/06_script_b.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if [ "${RUN_TIDY}" = "true" ]; then
3838
export P_CI_DIR="${BASE_BUILD_DIR}/bitcoin-$HOST/src/"
3939
CI_EXEC run-clang-tidy "${MAKEJOBS}"
4040
export P_CI_DIR="${BASE_BUILD_DIR}/bitcoin-$HOST/"
41-
CI_EXEC "python3 ${BASE_SCRATCH_DIR}/iwyu/include-what-you-use/iwyu_tool.py"\
41+
CI_EXEC "python3 ${DIR_IWYU}/include-what-you-use/iwyu_tool.py"\
4242
" src/compat"\
4343
" src/init"\
4444
" src/rpc/signmessage.cpp"\

0 commit comments

Comments
 (0)