Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tools/ci to use newer xshell #69

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion macros/src/abilitylike.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use syn::{DeriveInput, Ident};
/// This approach and implementation is inspired by the `strum` crate,
/// Copyright (c) 2019 Peter Glotfelty
/// available under the MIT License at https://github.com/Peternator7/strum

pub(crate) fn abilitylike_inner(ast: &DeriveInput) -> TokenStream {
// Splitting the abstract syntax tree
let enum_name = &ast.ident;
Expand Down
1 change: 0 additions & 1 deletion src/premade_pools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pub mod life {
/// # Panics
/// Panics if `current` is greater than `max`.
/// Panics if `current` or max is negative.

pub fn new(current: Life, max: Life, regen_per_second: Life) -> Self {
assert!(current <= max);
assert!(current >= LifePool::MIN);
Expand Down
2 changes: 1 addition & 1 deletion tools/ci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
xshell = "0.1"
xshell = "0.2"
28 changes: 18 additions & 10 deletions tools/ci/src/main.rs
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.");
}
Loading