Skip to content

Commit

Permalink
Only test MSRV with minimal versions
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Jan 30, 2024
1 parent aba88fb commit 5ab7376
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ jobs:
run: cargo test --verbose

verify-msrv:
runs-on: ubuntu-latest
name: verify minimum supported rust version (ubuntu)
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
name: verify minimum supported rust version without cache (takes longer, but caching produces unexpected behaviour)
timeout-minutes: 30

# we are using the `cargo-msrv` app
Expand All @@ -47,13 +50,27 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install foresterre/cargo-msrv without cache (takes longer, but caching produces unexpected behaviour)
- name: Install foresterre/cargo-msrv
run: cargo install cargo-msrv

- name: Verify the Rustc version declared in `cargo.toml` without cache (takes longer, but caching produces unexpected behaviour)
- uses: dtolnay/rust-toolchain@nightly
- name: Generate Cargo.lock with minimal-version dependencies
run: cargo -Zminimal-versions generate-lockfile

- name: Verify the Rustc version declared in `Cargo.toml`
run: cargo-msrv verify

- name: Verify MSRV with suggested `cargo update -p half --precise 2.1.0` workaround
run: |
rm -f Cargo.lock
cargo update
cargo update -p half --precise 2.1.0
cargo-msrv verify
- name: Verify MSRV with suggested `half = "=2.1.0"` workaround
run: |
cargo update
# Workaround should be available in any crate
sed -i 's/half = "2.1.0"/half = "=2.1.0"/' Cargo.toml
cargo-msrv verify
# github actions does not support big endian systems directly, but it does support QEMU.
Expand Down Expand Up @@ -94,16 +111,16 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Cache Cargo Dependencies
uses: Swatinem/rust-cache@v1.3.0

- name: Add wasm32 Target
run: rustup target add wasm32-unknown-unknown

- name: Build without default features
run: cargo build --verbose --no-default-features --target wasm32-unknown-unknown

- name: Run tests without default features
run: cargo test --verbose --no-default-features

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Features include:
> [!TIP]
> MSRV Note: This crate is now on Rust `1.70.0`. If you want to use the
> newest version of `exrs` with an older Rust version, you can still do that:
> By specifying a version `half = "2.1.0"` in your project, the crate will work with Rust `1.59.0`.
> By specifying a version `half = "=2.1.0"` in your project, or generating a lock file with minimal version dependencies (`cargo +nightly -Zminimal-versions generate-lockfile`), the crate will work with Rust `1.61.0`.
This library has matured quite a bit, but should still be considered incomplete.
For example, deep data and DWA compression algorithms are not supported yet.
Expand Down

0 comments on commit 5ab7376

Please sign in to comment.