Repository navigation
Expand file tree
/
Copy pathJustfile
More file actions
52 lines (42 loc) · 1.44 KB
/
Copy pathJustfile
File metadata and controls
52 lines (42 loc) · 1.44 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
book-src := justfile_directory() / 'docs' / 'book'
CI-SET-ENV := 'export RUSTFLAGS="-Dwarnings ${RUSTFLAGS:- }" RUSTDOCFLAGS="-Dwarnings ${RUSTDOCFLAGS:- }"'
[private]
default:
@just --unsorted --list
# compile and run tytanic
run *args='--release':
cargo run {{ args }}
# run lints project wide
check:
# FIXME(tinger): mdbook-linkcheck is disabled, because some links are
# deliberately pointing to the generated html files, see:
# https://github.com/rust-lang/mdBook/issues/984
# mdbook-linkcheck --standalone {{ book-src }}
mdbook test {{ book-src }}
cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features
# run tests project wide
test:
cargo insta test --test-runner nextest --workspace
# build and serve the book locally
book *args='--open':
mdbook serve {{ book-src }} {{ args }}
# run tests and checks similar to CI
ci:
{{ CI-SET-ENV }} && cargo fmt --all --check
{{ CI-SET-ENV }} && cargo clippy --workspace
{{ CI-SET-ENV }} && cargo test --workspace --no-fail-fast
{{ CI-SET-ENV }} && cargo doc --workspace --no-deps
@echo ""
@echo These checks are not exactly the same as CI, but should get you there most of the way.
@echo ""
# build the docker image
docker:
docker build . --tag 'tytanic:latest'
# clean all temporary directories and build artifacts
clean:
rm -r target
rm -r {{ book-src / 'build' }}
# install tytanic using cargo
install *args='--force':
cargo install --path crates/tytanic {{ args }}