ratatui/Makefile.toml
SLASHLogin 6bdb97c55c
ci(makefile): split CI jobs (#278)
- Split CI into build, clippy and test.
- Run format on nightly only due to the settings being unstable
2023-06-26 07:31:30 +00:00

275 lines
4.9 KiB
TOML

# configuration for https://github.com/sagiegurari/cargo-make
[config]
skip_core_tasks = true
[tasks.ci]
run_task = [
{ name = "ci-unix", condition = { platforms = [
"linux",
"mac",
] } },
{ name = "ci-windows", condition = { platforms = [
"windows",
] } },
]
[tasks.ci-unix]
private = true
dependencies = [
"style-check",
"check-unix",
"test-unix",
"clippy-unix",
]
[tasks.ci-windows]
private = true
dependencies = [
"style-check",
"check-windows",
"test-windows",
"clippy-windows",
]
[tasks.style-check]
dependencies = ["fmt", "typos"]
[tasks.fmt]
toolchain = "nightly"
command = "cargo"
args = ["fmt", "--all", "--check"]
[tasks.typos]
install_crate = { crate_name = "typos-cli", binary = "typos", test_arg = "--version" }
command = "typos"
[tasks.check]
run_task = [
{ name = "check-unix", condition = { platforms = [
"linux",
"mac",
] } },
{ name = "check-windows", condition = { platforms = [
"windows",
] } },
]
[tasks.check-unix]
private = true
dependencies = [
"check-crossterm",
"check-termion",
"check-termwiz",
]
[tasks.check-windows]
private = true
dependencies = [
"check-crossterm",
"check-termwiz",
]
[tasks.check-crossterm]
env = { TUI_FEATURES = "serde,crossterm" }
run_task = "check-backend"
[tasks.check-termion]
env = { TUI_FEATURES = "serde,termion" }
run_task = "check-backend"
[tasks.check-termwiz]
env = { TUI_FEATURES = "serde,termwiz" }
run_task = "check-backend"
[tasks.check-backend]
command = "cargo"
condition = { env_set = ["TUI_FEATURES"] }
args = [
"check",
"--no-default-features",
"--features",
"${TUI_FEATURES}",
"--all-targets",
]
[tasks.build]
run_task = [
{ name = "build-unix", condition = { platforms = [
"linux",
"mac",
] } },
{ name = "build-windows", condition = { platforms = [
"windows",
] } },
]
[tasks.build-unix]
private = true
dependencies = [
"build-crossterm",
"build-termion",
"build-termwiz",
]
[tasks.build-windows]
private = true
dependencies = [
"build-crossterm",
"build-termwiz",
]
[tasks.build-crossterm]
env = { TUI_FEATURES = "serde,crossterm" }
run_task = "build-backend"
[tasks.build-termion]
env = { TUI_FEATURES = "serde,termion" }
run_task = "build-backend"
[tasks.build-termwiz]
env = { TUI_FEATURES = "serde,termwiz" }
run_task = "build-backend"
[tasks.build-backend]
command = "cargo"
condition = { env_set = ["TUI_FEATURES"] }
args = [
"build",
"--no-default-features",
"--features",
"${TUI_FEATURES}",
"--all-targets",
]
[tasks.clippy]
run_task = [
{ name = "clippy-unix", condition = { platforms = [
"linux",
"mac",
] } },
{ name = "clippy-windows", condition = { platforms = [
"windows",
] } },
]
[tasks.clippy-unix]
private = true
dependencies = [
"clippy-crossterm",
"clippy-termion",
"clippy-termwiz",
]
[tasks.clippy-windows]
private = true
dependencies = [
"clippy-crossterm",
"clippy-termwiz",
]
[tasks.clippy-crossterm]
env = { TUI_FEATURES = "serde,crossterm" }
run_task = "clippy-backend"
[tasks.clippy-termion]
env = { TUI_FEATURES = "serde,termion" }
run_task = "clippy-backend"
[tasks.clippy-termwiz]
env = { TUI_FEATURES = "serde,termwiz" }
run_task = "clippy-backend"
[tasks.clippy-backend]
command = "cargo"
condition = { env_set = ["TUI_FEATURES"] }
args = [
"clippy",
"--all-targets",
"--no-default-features",
"--tests",
"--benches",
"--features",
"${TUI_FEATURES}",
"--",
"-D",
"warnings",
]
[tasks.test]
run_task = [
{ name = "test-unix", condition = { platforms = [
"linux",
"mac",
] } },
{ name = "test-windows", condition = { platforms = [
"windows",
] } },
]
[tasks.test-unix]
private = true
dependencies = [
"test-crossterm",
"test-termion",
"test-termwiz",
"test-doc",
]
[tasks.test-windows]
private = true
dependencies = [
"test-crossterm",
"test-termwiz",
"test-doc",
]
[tasks.test-crossterm]
env = { TUI_FEATURES = "serde,crossterm,all-widgets,macros" }
run_task = "test-backend"
[tasks.test-termion]
env = { TUI_FEATURES = "serde,termion,all-widgets,macros" }
run_task = "test-backend"
[tasks.test-termwiz]
env = { TUI_FEATURES = "serde,termwiz,all-widgets,macros" }
run_task = "test-backend"
[tasks.test-backend]
command = "cargo"
condition = { env_set = ["TUI_FEATURES"] }
args = [
"test",
"--no-default-features",
"--features",
"${TUI_FEATURES}",
"--all-targets",
]
[tasks.test-doc]
command = "cargo"
args = ["test", "--doc"]
[tasks.run-example]
private = true
condition = { env_set = ["TUI_EXAMPLE_NAME"] }
command = "cargo"
args = ["run", "--release", "--example", "${TUI_EXAMPLE_NAME}"]
[tasks.build-examples]
command = "cargo"
args = ["build", "--examples", "--release"]
[tasks.run-examples]
dependencies = ["build-examples"]
script = '''
#!@duckscript
files = glob_array ./examples/*.rs
for file in ${files}
name = basename ${file}
name = substring ${name} -3
set_env TUI_EXAMPLE_NAME ${name}
cm_run_task run-example
end
'''