Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad committed Nov 25, 2022
1 parent 18e47d7 commit bd87a4b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch tags for publish

- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6
- run: cargo run -p xtask -- ci
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
Expand Down
80 changes: 42 additions & 38 deletions xtask/src/main.rs
Expand Up @@ -5,50 +5,50 @@ use std::time::Instant;

use xshell::{cmd, Shell};

const MSRV: &str = "1.56.0";
// const MSRV: &str = "1.56.0";

fn main() -> xshell::Result<()> {
let sh = Shell::new()?;

let _e = push_toolchain(&sh, "stable")?;

{
let _s = section("BUILD");
cmd!(sh, "cargo test --workspace --no-run").run()?;
}

{
let _s = section("TEST");

for &release in &[None, Some("--release")] {
cmd!(sh, "cargo test --features unstable {release...}").run()?;
cmd!(
sh,
"cargo test --no-default-features --features unstable,std,parking_lot {release...}"
)
.run()?;
}

// Skip doctests for no_std tests as those don't work
cmd!(sh, "cargo test --no-default-features --features unstable --test it").run()?;
cmd!(sh, "cargo test --no-default-features --features unstable,alloc --test it").run()?;

cmd!(sh, "cargo test --no-default-features --features critical-section").run()?;
cmd!(sh, "cargo test --features critical-section").run()?;
}

{
let _s = section("TEST_BETA");
let _e = push_toolchain(&sh, "beta")?;
cmd!(sh, "cargo test --features unstable").run()?;
}

{
let _s = section("TEST_MSRV");
let _e = push_toolchain(&sh, MSRV)?;
sh.copy_file("Cargo.lock.msrv", "Cargo.lock")?;
cmd!(sh, "cargo build").run()?;
}
// {
// let _s = section("BUILD");
// cmd!(sh, "cargo test --workspace --no-run").run()?;
// }

// {
// let _s = section("TEST");

// for &release in &[None, Some("--release")] {
// cmd!(sh, "cargo test --features unstable {release...}").run()?;
// cmd!(
// sh,
// "cargo test --no-default-features --features unstable,std,parking_lot {release...}"
// )
// .run()?;
// }

// // Skip doctests for no_std tests as those don't work
// cmd!(sh, "cargo test --no-default-features --features unstable --test it").run()?;
// cmd!(sh, "cargo test --no-default-features --features unstable,alloc --test it").run()?;

// cmd!(sh, "cargo test --no-default-features --features critical-section").run()?;
// cmd!(sh, "cargo test --features critical-section").run()?;
// }

// {
// let _s = section("TEST_BETA");
// let _e = push_toolchain(&sh, "beta")?;
// cmd!(sh, "cargo test --features unstable").run()?;
// }

// {
// let _s = section("TEST_MSRV");
// let _e = push_toolchain(&sh, MSRV)?;
// sh.copy_file("Cargo.lock.msrv", "Cargo.lock")?;
// cmd!(sh, "cargo build").run()?;
// }

{
let _s = section("TEST_MIRI");
Expand All @@ -58,6 +58,10 @@ fn main() -> xshell::Result<()> {
sh.remove_path("./target")?;

cmd!(sh, "rustup component add miri").run()?;
cmd!(sh, "cargo --version").run()?;
let cargo = sh.var("CARGO");
eprintln!("cargo = {:?}", cargo);
cmd!(sh, "cargo miri --version").run()?;
cmd!(sh, "cargo miri setup").run()?;
cmd!(sh, "cargo miri test --features unstable").run()?;
}
Expand Down

0 comments on commit bd87a4b

Please sign in to comment.