Skip to content

Commit 23fe9e1

Browse files
authored
ci(build_docs): improve build_docs build time (#14912)
## Description Improve build_docs runtime by enabling `DD_FAST_BUILD=1` and rotating the cache. The cache restore/saving time was taking about 8+ minutes. I updated the cache to be time bound, so it'll rotate once per-month. After clearing the cache, the build took 10 minutes. ## Testing <!-- Describe your testing strategy or note what tests are included --> ## Risks <!-- Note any risks associated with this change, or "None" if no risks --> ## Additional Notes <!-- Any other information that would be helpful for reviewers -->
1 parent e888762 commit 23fe9e1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

scripts/docs/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -eux
33

44
# DEV: unless it's built with editable, following sphinx-build fails
5-
CMAKE_BUILD_PARALLEL_LEVEL=12 CARGO_BUILD_JOBS=12 pip install -v -e .
5+
DD_FAST_BUILD=1 CMAKE_BUILD_PARALLEL_LEVEL=12 CARGO_BUILD_JOBS=12 pip install -v -e .
66

77
if [[ "$(uname)" == "Darwin" ]]; then
88
export PYENCHANT_LIBRARY_PATH=/opt/homebrew/lib/libenchant-2.dylib

scripts/gen_gitlab_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ def gen_build_docs() -> None:
199199
".readthedocs.yml",
200200
}
201201
):
202+
date_str = datetime.datetime.now().strftime("%Y-%m")
203+
202204
with TESTS_GEN.open("a") as f:
203205
print("build_docs:", file=f)
204206
print(" extends: .testrunner", file=f)
@@ -212,7 +214,7 @@ def gen_build_docs() -> None:
212214
print(" hatch run docs:build", file=f)
213215
print(" mkdir -p /tmp/docs", file=f)
214216
print(" cache:", file=f)
215-
print(" key: v2-build_docs-pip-cache", file=f)
217+
print(f" key: build_docs-pip-cache-{date_str}", file=f)
216218
print(" paths:", file=f)
217219
print(" - .cache", file=f)
218220
print(" artifacts:", file=f)

0 commit comments

Comments
 (0)