summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci/env.sh
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab/ci/env.sh')
-rw-r--r--.gitlab/ci/env.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/.gitlab/ci/env.sh b/.gitlab/ci/env.sh
index 7634f5d..aa709a8 100644
--- a/.gitlab/ci/env.sh
+++ b/.gitlab/ci/env.sh
@@ -9,6 +9,16 @@ quietly() {
rm -f "$log"
}
+if test -n "$CMAKE_CI_IN_SYMLINK_TREE"; then
+ mkdir -p "$CI_PROJECT_DIR/real_work/work/build"
+ ln -s real_work/work "$CI_PROJECT_DIR/work"
+ git worktree prune
+ git worktree add "$CI_PROJECT_DIR/work/cmake" HEAD
+
+ # Assert that the hash matches.
+ test "$(git -C "$CI_PROJECT_DIR/work/cmake" rev-parse HEAD)" = "$(git -C "$CI_PROJECT_DIR" rev-parse HEAD)"
+fi
+
if test -r ".gitlab/ci/env_${CMAKE_CONFIGURATION}.sh"; then
source ".gitlab/ci/env_${CMAKE_CONFIGURATION}.sh"
fi