diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfcfe65..676e0c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,19 +2,14 @@ name: CI on: push: - branches-ignore: [ - # We don't need to run on renovate PRs. - "renovate/**", - # This is the branch the merge queue creates. - "gh-readonly-queue/**", - ] + branches: [trunk] pull_request: env: RUSTFLAGS: -D warnings RUSTDOCFLAGS: -D warnings CI_RUST_VERSION: "1.85" - MSRV: "1.65" + MSRV: "1.71" jobs: build: @@ -49,6 +44,9 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install cargo-nextest + uses: taiki-e/install-action@nextest + - name: install rust shell: bash run: | @@ -68,7 +66,7 @@ jobs: - name: test shell: bash if: matrix.name != 'stable wasm' - run: cargo test --all-features --target ${{ matrix.target }} + run: cargo nextest run --all-features --target ${{ matrix.target }} msrv: runs-on: ubuntu-latest @@ -86,6 +84,13 @@ jobs: rustup override set ${{ env.MSRV }} cargo -V + - name: downgrade dependencies + run: | + set -e + + # 2.12.0 bumps MSRV to 1.82. + cargo update -p indexmap --precise 2.11.0 + - name: check msrv run: | set -e diff --git a/CHANGELOG.md b/CHANGELOG.md index b7a5417..c731bb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,10 +15,13 @@ and this project adheres to cargo's version of [Semantic Versioning](https://sem ## Unreleased -Released 2025-04-26 +#### Changes +- MSRV updated to `1.71`. ## v0.3.1 +Released 2025-04-26 + #### Changes - Updated dependencies. diff --git a/Cargo.toml b/Cargo.toml index 600fa82..47fbf98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/BVE-Reborn/switchyard" license = "MIT OR Apache-2.0 OR Zlib" keywords = [] categories = [] -rust-version = "1.65" +rust-version = "1.71" [[bench]] name = "scheduling" @@ -27,7 +27,7 @@ slotmap = "1" affinity = "0.1.2" [dev-dependencies] -async-std = "1.6" +tokio = { version = "1", features = ["rt-multi-thread"] } criterion = "0.6" flume = "0.11" futures-executor = "0.3" diff --git a/README.md b/README.md index ab8dd3b..f7a552b 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,7 @@ let yard = Switchyard::new(one_to_one(thread_info(), Some("thread-name")), || Ce yard.spawn_local(0, |data| async move { data.set(10) }); ``` -## MSRV -1.65 +## MSRV71 Future MSRV bumps will be breaking changes. diff --git a/benches/scheduling.rs b/benches/scheduling.rs index c6952bd..9770e22 100644 --- a/benches/scheduling.rs +++ b/benches/scheduling.rs @@ -16,14 +16,16 @@ pub fn wide(c: &mut Criterion) { group.throughput(Throughput::Elements(count as u64)); - group.bench_function("async-std", |b| { + let rt = tokio::runtime::Runtime::new().unwrap(); + + group.bench_function("tokio", |b| { b.iter_batched( future_creation, |input| { - let handle_vec: Vec<_> = input.into_iter().map(|fut| async_std::task::spawn(fut)).collect(); - futures_executor::block_on(async move { + let handle_vec: Vec<_> = input.into_iter().map(|fut| rt.spawn(fut)).collect(); + rt.block_on(async move { for handle in handle_vec { - handle.await; + handle.await.unwrap(); } }) }, @@ -60,24 +62,26 @@ pub fn chain(c: &mut Criterion) { group.throughput(Throughput::Elements(count as u64)); - group.bench_function("async-std", |b| { + let rt = tokio::runtime::Runtime::new().unwrap(); + + group.bench_function("tokio", |b| { b.iter_batched( || { let receiver = receiver.clone(); - let mut head = async_std::task::spawn(async move { + let mut head = rt.spawn(async move { receiver.recv_async().await.unwrap(); }); for _ in 0..count { let old_head = head; - head = async_std::task::spawn(async move { - old_head.await; + head = rt.spawn(async move { + old_head.await.unwrap(); }); } head }, |input| { sender.send(()).unwrap(); - futures_executor::block_on(input) + rt.block_on(async { input.await.unwrap() }) }, BatchSize::PerIteration, )