xtask: Simplify code for ci task
This commit is contained in:
parent
d53f2ba71b
commit
f5955cee9e
@ -1,5 +1,3 @@
|
|||||||
#![allow(clippy::vec_init_then_push)]
|
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use xshell::pushd;
|
use xshell::pushd;
|
||||||
@ -45,51 +43,35 @@ impl CiTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn build_stable(&self) -> xshell::Result<()> {
|
fn build_stable(&self) -> xshell::Result<()> {
|
||||||
let mut r = Vec::new();
|
vec![
|
||||||
r.push(cmd!("rustup run stable cargo test --workspace --quiet").run());
|
cmd!("rustup run stable cargo test --workspace --quiet").run(),
|
||||||
|
cmd!("rustup run stable cargo test -p ruma-identifiers --no-default-features --quiet")
|
||||||
{
|
.run(),
|
||||||
let _p = pushd("ruma-identifiers")?;
|
cmd!("rustup run stable cargo test -p ruma-identifiers --all-features --quiet").run(),
|
||||||
r.push(cmd!("rustup run stable cargo test --no-default-features --quiet").run());
|
cmd!("rustup run stable cargo test -p ruma-client-api --all-features --quiet").run(),
|
||||||
r.push(cmd!("rustup run stable cargo test --all-features --quiet").run());
|
cmd!("rustup run stable cargo check -p ruma-client --no-default-features --quiet")
|
||||||
}
|
.run(),
|
||||||
|
cmd!("rustup run stable cargo check -p ruma-client --all-features --quiet").run(),
|
||||||
{
|
]
|
||||||
let _p = pushd("ruma-client-api");
|
.into_iter()
|
||||||
r.push(cmd!("rustup run stable cargo test --all-features --quiet").run());
|
.collect()
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
let _p = pushd("ruma-client")?;
|
|
||||||
r.push(cmd!("rustup run stable cargo check --no-default-features --quiet").run());
|
|
||||||
r.push(cmd!("rustup run stable cargo check --all-features --quiet").run());
|
|
||||||
}
|
|
||||||
|
|
||||||
r.into_iter().collect()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_nightly(&self) -> xshell::Result<()> {
|
fn build_nightly(&self) -> xshell::Result<()> {
|
||||||
let mut r = Vec::new();
|
vec![
|
||||||
r.push(cmd!("rustup run nightly cargo fmt -- --check").run());
|
cmd!("rustup run nightly cargo fmt -- --check").run(),
|
||||||
|
|
||||||
{
|
|
||||||
let _p = pushd("ruma");
|
|
||||||
r.push(
|
|
||||||
cmd!(
|
cmd!(
|
||||||
"rustup run nightly cargo clippy
|
"rustup run nightly cargo clippy -p ruma
|
||||||
--all-targets --all-features --quiet -- -D warnings"
|
--all-targets --all-features --quiet -- -D warnings"
|
||||||
)
|
)
|
||||||
.run(),
|
.run(),
|
||||||
);
|
cmd!(
|
||||||
}
|
"rustup run nightly cargo clippy -p ruma-client
|
||||||
|
--all-targets --quiet -- -D warnings"
|
||||||
{
|
)
|
||||||
let _p = pushd("ruma-client");
|
.run(),
|
||||||
r.push(
|
]
|
||||||
cmd!("rustup run nightly cargo clippy --all-targets --quiet -- -D warnings").run(),
|
.into_iter()
|
||||||
);
|
.collect()
|
||||||
}
|
|
||||||
|
|
||||||
r.into_iter().collect()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user