diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh index d04ff9925f7..cfec6c26513 100755 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -49,6 +49,19 @@ echo "=== BEGIN env ===" env echo "=== END env ===" +# The CI framework should be flexible where it is run from. For example, from +# a git-archive, a git-worktree, or a normal git repo. +# The iwyu task requires a working git repo, which may not always be +# available, so initialize one with force. +if [[ "${RUN_IWYU}" == true ]]; then + mv .git .git_ci_backup || true + git init + git add ./src # the git diff command used later for iwyu only cares about ./src + git config user.email "ci@ci" + git config user.name "CI" + git commit -m "dummy CI ./src init for IWYU" +fi + if [ "$RUN_FUZZ_TESTS" = "true" ]; then export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_corpora/ if [ ! -d "$DIR_FUZZ_IN" ]; then