Skip to content

Commit 141d5fb

Browse files
committed
[github] pre-cache llvm-project in Linux CI Docker images
Linux CI bots take a bit over a minute to fully set their git repos up, always starting from scratch. This can end up being a significant percentage of their overall runtime. If llvm-project is built into the images & used as a cache, we could potentially speed that up quite a bit. Try it out and see.
1 parent f7fdc8d commit 141d5fb

File tree

1 file changed

+11
-0
lines changed
  • .github/workflows/containers/github-action-ci

1 file changed

+11
-0
lines changed

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,14 @@ RUN mkdir actions-runner && \
9494
tar xzf ./actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz && \
9595
rm ./actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz
9696

97+
# Pre-cache llvm-project in these images; this works with the premerge action
98+
# to speed up runs; cloning LLVM fresh takes >1min otherwise.
99+
#
100+
# A local experiment showed an explicit `git gc --aggressive` reduced this
101+
# layer's size by ~800MB (4.1GB -> 3.3GB). Disable GC'ing
102+
# afterward, so we don't waste time trying to do that in CI.
103+
RUN \
104+
git clone https://github.com/llvm/llvm-project --tags && \
105+
cd llvm-project && \
106+
git gc --aggressive && \
107+
git config gc.auto 0

0 commit comments

Comments
 (0)