2021-03-29 15:44:30 +00:00
|
|
|
ifeq ($(CI), true)
|
|
|
|
ci_color_always := --color=always
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS), Windows_NT)
|
|
|
|
NIX := false
|
|
|
|
else
|
|
|
|
NIX := true
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: build clean install test uninstall
|
|
|
|
|
|
|
|
build:
|
2021-05-07 07:34:44 +00:00
|
|
|
cargo build $(ci_color_always)
|
2021-03-29 15:44:30 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
cargo clean $(ci_color_always)
|
|
|
|
|
|
|
|
install:
|
|
|
|
cargo install --path=. $(ci_color_always)
|
|
|
|
|
|
|
|
ifeq ($(NIX), true)
|
|
|
|
test:
|
2021-04-05 06:31:24 +00:00
|
|
|
nix-shell --pure --run 'cargo fmt -- --check --files-with-diff $(ci_color_always)'
|
2021-05-07 07:34:44 +00:00
|
|
|
nix-shell --pure --run 'cargo check --all-features $(ci_color_always)'
|
|
|
|
nix-shell --pure --run 'cargo clippy --all-features $(ci_color_always) -- --deny warnings --deny clippy::all'
|
|
|
|
nix-shell --pure --run 'cargo test --all-features --no-fail-fast $(ci_color_always)'
|
2021-06-06 14:47:11 +00:00
|
|
|
nix-shell --pure --run 'cargo audit --deny warnings $(ci_color_always)'
|
2021-03-29 15:44:30 +00:00
|
|
|
else
|
|
|
|
test:
|
|
|
|
cargo fmt -- --check --files-with-diff $(ci_color_always)
|
2021-05-07 07:34:44 +00:00
|
|
|
cargo check --all-features $(ci_color_always)
|
|
|
|
cargo clippy --all-features $(ci_color_always) -- --deny warnings --deny clippy::all
|
|
|
|
cargo test --no-fail-fast $(ci_color_always)
|
2021-06-06 14:47:11 +00:00
|
|
|
cargo audit --deny warnings $(ci_color_always)
|
2021-03-29 15:44:30 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
cargo uninstall $(ci_color_always)
|