ci(makefile): remove termion dependency from doc lint (#470)

Only build termion on non-windows targets
This commit is contained in:
Josh McKinney 2023-09-05 16:39:34 -07:00 committed by GitHub
parent c8ab2d5908
commit c95a75c5d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,6 +7,12 @@ skip_core_tasks = true
# all features except the backend ones # all features except the backend ones
ALL_FEATURES = "all-widgets,macros,serde" ALL_FEATURES = "all-widgets,macros,serde"
# Windows does not support building termion, so this avoids the build failure by providing two
# sets of flags, one for Windows and one for other platforms.
# Windows: --features=all-widgets,macros,serde,crossterm,termwiz
# Other: --all-features
ALL_FEATURES_FLAG = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "--all-features", mapping = { "windows" = "--features=all-widgets,macros,serde,crossterm,termwiz" } }
[tasks.default] [tasks.default]
alias = "ci" alias = "ci"
@ -41,7 +47,8 @@ toolchain = "nightly"
command = "cargo" command = "cargo"
args = [ args = [
"rustdoc", "rustdoc",
"--all-features", "--no-default-features",
"${ALL_FEATURES_FLAG}",
"--", "--",
"-Zunstable-options", "-Zunstable-options",
"--check", "--check",
@ -51,54 +58,33 @@ args = [
[tasks.check] [tasks.check]
description = "Check code for errors and warnings" description = "Check code for errors and warnings"
command = "cargo" command = "cargo"
args = ["check", "--all-targets", "--all-features"]
[tasks.check.windows]
args = [ args = [
"check", "check",
"--all-targets", "--all-targets",
"--no-default-features", "--no-default-features",
"--features", "${ALL_FEATURES_FLAG}",
"${ALL_FEATURES},crossterm,termwiz",
] ]
[tasks.build] [tasks.build]
description = "Compile the project" description = "Compile the project"
command = "cargo" command = "cargo"
args = ["build", "--all-targets", "--all-features"]
[tasks.build.windows]
args = [ args = [
"build", "build",
"--all-targets", "--all-targets",
"--no-default-features", "--no-default-features",
"--features", "${ALL_FEATURES_FLAG}",
"${ALL_FEATURES},crossterm,termwiz",
] ]
[tasks.clippy] [tasks.clippy]
description = "Run Clippy for linting" description = "Run Clippy for linting"
command = "cargo" command = "cargo"
args = [
"clippy",
"--all-targets",
"--tests",
"--benches",
"--all-features",
"--",
"-D",
"warnings",
]
[tasks.clippy.windows]
args = [ args = [
"clippy", "clippy",
"--all-targets", "--all-targets",
"--tests", "--tests",
"--benches", "--benches",
"--no-default-features", "--no-default-features",
"--features", "${ALL_FEATURES_FLAG}",
"${ALL_FEATURES},crossterm,termwiz",
"--", "--",
"-D", "-D",
"warnings", "warnings",
@ -108,33 +94,17 @@ args = [
description = "Run tests" description = "Run tests"
dependencies = ["test-doc"] dependencies = ["test-doc"]
command = "cargo" command = "cargo"
args = ["test", "--all-targets", "--all-features"]
[tasks.test-windows]
description = "Run tests on Windows"
dependencies = ["test-doc"]
args = [ args = [
"test", "test",
"--all-targets", "--all-targets",
"--no-default-features", "--no-default-features",
"--features", "${ALL_FEATURES_FLAG}",
"${ALL_FEATURES},crossterm,termwiz",
] ]
[tasks.test-doc] [tasks.test-doc]
description = "Run documentation tests" description = "Run documentation tests"
command = "cargo" command = "cargo"
args = ["test", "--doc", "--all-features"] args = ["test", "--doc", "--no-default-features", "${ALL_FEATURES_FLAG}"]
[tasks.test-doc.windows]
args = [
"test",
"--doc",
"--no-default-features",
"--features",
"${ALL_FEATURES},crossterm,termwiz",
]
[tasks.test-backend] [tasks.test-backend]
# takes a command line parameter to specify the backend to test (e.g. "crossterm") # takes a command line parameter to specify the backend to test (e.g. "crossterm")
@ -148,28 +118,16 @@ args = [
"${ALL_FEATURES},${@}", "${ALL_FEATURES},${@}",
] ]
[tasks.coverage] [tasks.coverage]
description = "Generate code coverage report" description = "Generate code coverage report"
command = "cargo" command = "cargo"
args = [
"llvm-cov",
"--lcov",
"--output-path",
"target/lcov.info",
"--all-features",
]
[tasks.coverage.windows]
command = "cargo"
args = [ args = [
"llvm-cov", "llvm-cov",
"--lcov", "--lcov",
"--output-path", "--output-path",
"target/lcov.info", "target/lcov.info",
"--no-default-features", "--no-default-features",
"--features", "${ALL_FEATURES_FLAG}",
"${ALL_FEATURES},crossterm,termwiz",
] ]
[tasks.run-example] [tasks.run-example]