Skip to content

Commit 5ccd59b

Browse files
committed
Update Earthfile
1 parent 2259dd4 commit 5ccd59b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Earthfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
VERSION 0.6
12
FROM rustlang/rust:nightly-buster-slim
23
WORKDIR /rustexample
34

5+
all:
6+
BUILD +build
7+
BUILD +check
8+
49
install-chef:
10+
ENV CARGO_UNSTABLE_SPARSE_REGISTRY=true
511
RUN cargo install --debug cargo-chef
612

713
prepare-cache:
@@ -14,17 +20,25 @@ prepare-cache:
1420
build-cache:
1521
FROM +install-chef
1622
COPY +prepare-cache/recipe.json ./
23+
RUN cargo chef cook --release
1724
RUN cargo chef cook
1825
SAVE ARTIFACT target
1926
SAVE ARTIFACT $CARGO_HOME cargo_home
2027

2128
build:
2229
COPY --dir src Cargo.lock Cargo.toml .
2330
COPY +build-cache/cargo_home $CARGO_HOME
31+
ENV CARGO_UNSTABLE_SPARSE_REGISTRY=true
2432
RUN cargo build --release
2533
RUN strip target/release/highlight-assertions
2634
SAVE ARTIFACT target/release/highlight-assertions AS LOCAL earthly-artifacts/highlight-assertions
2735

36+
check:
37+
COPY --dir src Cargo.lock Cargo.toml .
38+
COPY +build-cache/cargo_home $CARGO_HOME
39+
ENV CARGO_UNSTABLE_SPARSE_REGISTRY=true
40+
RUN cargo fmt --check
41+
RUN cargo clippy
2842
#docker:
2943
#FROM debian:buster-slim
3044
#COPY +build/example-rust example-rust

0 commit comments

Comments
 (0)