forked from URI-ABD/clam
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEarthfile
More file actions
64 lines (53 loc) · 1.73 KB
/
Earthfile
File metadata and controls
64 lines (53 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
VERSION 0.7
FROM rust:latest
WORKDIR /usr/local/src
# The cache directive creates a buildkit cache mount point. This allows us to cache the dependencies between builds.
CACHE ./target/
# Add any additional rustup components here. They are available in all targets.
RUN rustup component add \
rustfmt \
clippy
# Add any additional packages here. They are available in all targets.
RUN cargo install \
cargo-chef \
jaq
# This target prepares the recipe.json file for the build stage.
chef-prepare:
COPY --dir crates Cargo.toml .
RUN cargo chef prepare
SAVE ARTIFACT recipe.json
# This target uses the recipe.json file to build a cache of the dependencies.
chef-cook:
COPY +chef-prepare/recipe.json ./
RUN cargo chef cook --release
COPY --dir crates Cargo.toml .
# This target builds the project using the cached dependencies.
build:
FROM +chef-cook
RUN cargo build --release
SAVE ARTIFACT target/release AS LOCAL ./target/
# This target formats the project.
fmt:
FROM +chef-cook
RUN cargo fmt --all
SAVE ARTIFACT crates AS LOCAL ./
RUN cargo fmt --all -- --check
# This target lints the project.
clippy:
FROM +fmt
RUN cargo clippy --all-targets --all-features
# This target runs the tests.
test:
FROM +fmt
RUN cargo test --release --lib --bins --examples --tests --all-features
# This target runs the tests on aarch64, it can be expanded to run tests on additional platforms, but it is SLOW.
cross-test:
FROM +fmt
RUN cargo install cross --git https://github.com/cross-rs/cross
WITH DOCKER
RUN cross test --target aarch64-unknown-linux-gnu --all-features
END
# This target runs the benchmarks.
bench:
FROM +fmt
RUN cargo bench --all-features