Let Github runners reuse caches for Rust and Nixpkgs

This commit is contained in:
Qingsong Chen 2025-07-22 03:09:51 +00:00 committed by Tate, Hongliang Tian
parent edbab2093a
commit 171b9803ad
2 changed files with 10 additions and 0 deletions

View File

@ -145,6 +145,12 @@ RUN curl https://sh.rustup.rs -sSf | \
&& cargo -V \
&& rustup component add rust-src rustc-dev llvm-tools-preview
# Let Github runners reuse the Rust toolchain installed in the Dockerfile and
# also the Cargo crates downloaded subsequently in the Docker build process.
RUN mkdir -p /github/home \
&& ln -s /root/.cargo /github/home/.cargo \
&& ln -s /root/.rustup /github/home/.rustup
# Install cargo tools
RUN cargo install \
cargo-binutils \

View File

@ -39,6 +39,10 @@ RUN make general_pkgs VERBOSE=0 \
# Clean source files
RUN rm -rf /root/test
# Let Github runners reuse Nixpkgs tarball installed in the Dockerfile.
RUN mkdir -p /github/home/.cache \
&& ln -s /root/.cache/nix /github/home/.cache/nix
VOLUME [ "/root/asterinas" ]
WORKDIR /root/asterinas