-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tools/ci to use newer xshell (#69)
Xshell 1.0 is not compatible with nightly rust, and may not be comatible with upcoming stable rust versions. See matklad/xshell#97
- Loading branch information
Showing
4 changed files
with
19 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,42 @@ | ||
use xshell::cmd; | ||
use xshell::{cmd, Shell}; | ||
|
||
fn main() { | ||
// When run locally, results may differ from actual CI runs triggered by | ||
// .github/workflows/ci.yml | ||
// - Official CI runs latest stable | ||
// - Local runs use whatever the default Rust is locally | ||
|
||
let sh = Shell::new().unwrap(); | ||
|
||
// See if any code needs to be formatted | ||
cmd!("cargo fmt --all -- --check") | ||
cmd!(sh, "cargo fmt --all -- --check") | ||
.run() | ||
.expect("Please run `cargo fmt --all` to format your code."); | ||
|
||
// See if clippy has any complaints. | ||
// - Type complexity must be ignored because we use huge templates for queries | ||
cmd!("cargo clippy --workspace --all-features -- -D warnings -A clippy::type_complexity") | ||
.run() | ||
.expect("Please fix `cargo clippy` errors with all features enabled."); | ||
cmd!( | ||
sh, | ||
"cargo clippy --workspace --all-features -- -D warnings -A clippy::type_complexity" | ||
) | ||
.run() | ||
.expect("Please fix `cargo clippy` errors with all features enabled."); | ||
|
||
// Check for errors with no features enabled | ||
cmd!("cargo check --workspace --no-default-features") | ||
cmd!(sh, "cargo check --workspace --no-default-features") | ||
.run() | ||
.expect("Please fix `cargo check` errors with no features enabled ."); | ||
|
||
// Check for errors with default features enabled | ||
cmd!("cargo check --workspace") | ||
cmd!(sh, "cargo check --workspace") | ||
.run() | ||
.expect("Please fix `cargo check` errors with default features enabled."); | ||
|
||
// Check the examples with clippy | ||
cmd!("cargo clippy --examples -- -D warnings -A clippy::type_complexity") | ||
.run() | ||
.expect("Please fix `cargo clippy` errors for the examples."); | ||
cmd!( | ||
sh, | ||
"cargo clippy --examples -- -D warnings -A clippy::type_complexity" | ||
) | ||
.run() | ||
.expect("Please fix `cargo clippy` errors for the examples."); | ||
} |