forked from frankmcsherry/COST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
41 lines (33 loc) · 1.18 KB
/
Makefile.toml
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
[env]
UID = { script = ["id -u"] }
GID = { script = ["id -g"] }
UNAME = { script = ["id -un"] }
INT = { script = ["if [ ${INTERACTIVE} = no ]; then echo ; else echo i; fi"] }
IS_CI = { script = ["echo ${CI:-false}"] }
[tasks.format]
install_crate = "rustfmt"
command = "cargo"
args = ["fmt", "--"]
[tasks.clean]
command = "cargo"
args = ["clean"]
[tasks.test]
command = "cargo"
args = ["test"]
dependencies = ["clean"]
[tasks.dockerbuild]
command = "docker"
args = ["build", "--build-arg=IS_CI=${IS_CI}", "--build-arg=UNAME=${UNAME}", "--build-arg=UID=${UID}", "--build-arg=GID=${GID}", "-t", "cost:${UNAME}", "docker/"]
[tasks.docker]
command = "docker"
args = ["run", "-v", "/home/${UNAME}/.vim:/home/${UNAME}/.vim", "-v", "${CARGO_MAKE_WORKING_DIRECTORY}:/cost", "-t${INT}", "cost:${UNAME}", "${@}"]
dependencies = ["dockerbuild"]
[tasks.ci-fmt]
command = "makers"
args = ["docker", "/bin/bash", "-c", "/home/${UNAME}/.cargo/bin/cargo fmt -- --check"]
[tasks.ci-test]
command = "makers"
args = ["docker", "/bin/bash", "-c", "/home/${UNAME}/.cargo/bin/cargo test"]
[tasks.ci-test-release]
command = "makers"
args = ["docker", "/bin/bash", "-c", "/home/${UNAME}/.cargo/bin/cargo test --release"]