From fa847ed2f698a8a999352aeed63baf60b094e662 Mon Sep 17 00:00:00 2001 From: MacroFake Date: Fri, 29 Apr 2022 15:07:11 +0200 Subject: ci: Clone iwyu only if missing --- ci/test/04_install.sh | 11 +++++++---- ci/test/06_script_b.sh | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'ci/test') diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 227bdf3319..453a34ca78 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -112,10 +112,13 @@ if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then fi if [[ "${RUN_TIDY}" == "true" ]]; then - CI_EXEC "mkdir -p ${BASE_SCRATCH_DIR}/iwyu/build/" - 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" - CI_EXEC "cd ${BASE_SCRATCH_DIR}/iwyu/build && cmake -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-14 ../include-what-you-use" - CI_EXEC "cd ${BASE_SCRATCH_DIR}/iwyu/build && make install $MAKEJOBS" + export DIR_IWYU="${BASE_SCRATCH_DIR}/iwyu" + if [ ! -d "${DIR_IWYU}" ]; then + CI_EXEC "mkdir -p ${DIR_IWYU}/build/" + 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" + CI_EXEC "cd ${DIR_IWYU}/build && cmake -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-14 ../include-what-you-use" + CI_EXEC "cd ${DIR_IWYU}/build && make install $MAKEJOBS" + fi fi if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then diff --git a/ci/test/06_script_b.sh b/ci/test/06_script_b.sh index 40547f19ef..d634875d40 100755 --- a/ci/test/06_script_b.sh +++ b/ci/test/06_script_b.sh @@ -38,7 +38,7 @@ if [ "${RUN_TIDY}" = "true" ]; then export P_CI_DIR="${BASE_BUILD_DIR}/bitcoin-$HOST/src/" CI_EXEC run-clang-tidy "${MAKEJOBS}" export P_CI_DIR="${BASE_BUILD_DIR}/bitcoin-$HOST/" - CI_EXEC "python3 ${BASE_SCRATCH_DIR}/iwyu/include-what-you-use/iwyu_tool.py"\ + CI_EXEC "python3 ${DIR_IWYU}/include-what-you-use/iwyu_tool.py"\ " src/compat"\ " src/init"\ " src/rpc/signmessage.cpp"\ -- cgit v1.2.3