ci: fail on `warning` for all `CI` tests
@@ -24,7 +24,13 @@ ext {
task lint_cargo_fmt_check {
doLast {
- exec { commandLine cargo('fmt', '--all', '--', '--check') }
+ exec {
+ if (ci) {
+ environment RUSTFLAGS: "-Dwarnings"
+ }
+
+ commandLine cargo('fmt', '--all', '--', '--check')
+ }
}
}
@@ -50,7 +56,13 @@ task lint {
task build_docs {
doLast {
- exec { commandLine cargo('doc', '--no-deps') }
+ exec {
+ if (ci) {
+ environment RUSTFLAGS: "-Dwarnings"
+ }
+
+ commandLine cargo('doc', '--no-deps')
+ }
}
}
@@ -58,9 +70,10 @@ task build {
doLast {
exec {
if (ci) {
- environment RUSTFLAGS: "-Cdebuginfo=0"
+ environment RUSTFLAGS: "-Cdebuginfo=0 -Dwarnings"
environment CARGO_INCREMENTAL: "0"
}
+
commandLine cargo('--locked', 'build')
}
}
@@ -70,9 +83,10 @@ task build_examples {
doLast {
exec {
if (ci) {
- environment RUSTFLAGS: "-Cdebuginfo=0"
+ environment RUSTFLAGS: "-Cdebuginfo=0 -Dwarnings"
environment CARGO_INCREMENTAL: "0"
}
+
commandLine cargo('--locked', 'build', '--examples')
}
}
@@ -83,7 +97,13 @@ task test {
description 'Test the project.'
doLast {
- exec { commandLine cargo('--locked', 'test') }
+ exec {
+ if (ci) {
+ environment RUSTFLAGS: "-Dwarnings"
+ }
+
+ commandLine cargo('--locked', 'test')
+ }
}
}
