Skip to content

Commit

Permalink
Prep 0.9.3: lints, MSRV, minimal crates (#13)
Browse files Browse the repository at this point in the history
- Update lints
- Set MSRV and enforce in CI
- Fix crate depenencies and check minimal vesions in CI
- Prep 0.9.3 release
  • Loading branch information
flub authored Dec 4, 2024
1 parent 6011019 commit e1b8b18
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 13 deletions.
38 changes: 29 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ concurrency:
cancel-in-progress: true

env:
RUST_BACKTRACE: "1"
RUSTFLAGS: "-Dwarnings"
RUSTDOCFLAGS: "-Dwarnings"
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "true"
MSRV: "1.76"
RUST_BACKTRACE: "1"
RUSTFLAGS: "-Dwarnings"
RUSTDOCFLAGS: "-Dwarnings"
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "true"

jobs:
lints:
Expand All @@ -23,7 +24,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: mozilla-actions/sccache-action@v0.0.3
- uses: mozilla-actions/sccache-action@v0.0.6
- run: cargo fmt --check
- run: cargo clippy --no-deps
- run: cargo doc --no-deps --document-private-items
Expand All @@ -37,9 +38,28 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.3
- uses: mozilla-actions/sccache-action@v0.0.6
- uses: taiki-e/install-action@nextest
- run: cargo test
- run: cargo nextest run


minimal-crates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: mozilla-actions/sccache-action@v0.0.6
- name: cargo check
run: |
rm -f Cargo.lock
cargo +nightly check -Z minimal-versions
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
- uses: mozilla-actions/sccache-action@v0.0.6
- name: Check MSRV
run: |
cargo +$MSRV check
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v0.9.3

- Specify an MSRV in Cargo.toml, checked in CI.
- The minimal versions for dependencies are tweaked and now checked in CI.

## v0.9.2

- Pin cargo-platform dependency so we do not exceed MSRV of 0.76.
Expand Down
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "testdir"
version = "0.9.2"
version = "0.9.3"
authors = ["Floris Bruynooghe <flub@devork.be>"]
edition = "2021"
description = "Semi-persistent, scoped test directories"
Expand All @@ -10,8 +10,11 @@ license = "MIT OR Apache-2.0"
keywords = ["test", "temp", "temporary", "directory"]
categories = ["development-tools::testing", "filesystem"]

# Sadly this also needs to be updated in .github/workflows/ci.yml
rust-version = "1.76"

[dependencies]
anyhow = "1"
anyhow = "1.0.20"
backtrace = "0.3.55"
cargo_metadata = "0.14.0"
once_cell = "1.5"
Expand Down
2 changes: 1 addition & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
///
/// The module path is valid in any scope, so can be used together with [once_cell] (or
/// [lazy_static]) to share a common directory between different tests.
/// ```
/// ```no_run
/// use std::path::PathBuf;
/// use once_cell::sync::Lazy;
/// use testdir::testdir;
Expand Down
2 changes: 1 addition & 1 deletion src/numbered_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ mod tests {

let dir0 = NumberedDir::create(parent.path(), "base", NonZeroU8::new(3).unwrap()).unwrap();
let dir1 = NumberedDir::create(parent.path(), "base", NonZeroU8::new(3).unwrap()).unwrap();
let dirs = vec![dir0, dir1];
let dirs = [dir0, dir1];

for numdir in NumberedDir::iterate(parent.path(), "base").unwrap() {
assert!(dirs.contains(&numdir));
Expand Down

0 comments on commit e1b8b18

Please sign in to comment.