File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 2929 # Need load and tags so we can test it below
3030 load : true
3131 tags : test_tag
32+ cache-from : type=gha
33+ cache-to : type=gha,mode=max
3234
3335 - name : Test cli works in cached runtime image
3436 run : docker run --rm test_tag --version
Original file line number Diff line number Diff line change @@ -6,8 +6,15 @@ RUN rustup target add x86_64-unknown-linux-musl && \
66 apt-get install -y musl-tools musl-dev && \
77 update-ca-certificates
88
9+ # Build an empty project with only the Cargo files to improve the cache
10+ # performance of the container build. The src directory is expected to
11+ # change most frequently invalidating later caches so building early
12+ # allows built dependencies to be cached.
13+ RUN mkdir src && echo 'fn main() {}' > src/main.rs
914COPY ./Cargo.toml ./Cargo.toml
1015COPY ./Cargo.lock ./Cargo.lock
16+ RUN cargo build --release --target x86_64-unknown-linux-musl
17+
1118COPY ./src ./src
1219
1320RUN cargo build --release --target x86_64-unknown-linux-musl
You can’t perform that action at this time.
0 commit comments