Skip to content

Commit

Permalink
Fix msrv check
Browse files Browse the repository at this point in the history
  • Loading branch information
Finomnis committed Jun 23, 2024
1 parent 1fc4ff5 commit d454d1e
Showing 1 changed file with 27 additions and 76 deletions.
103 changes: 27 additions & 76 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,41 @@ jobs:
RUSTDOCFLAGS: "-Dwarnings"
run: cargo doc --no-deps --examples --all-features


msrv:
name: Minimum Supported Rust Version
name: Minimum Supported Rust Version, based on min dependency versions
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Install cargo-binstall
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly

- name: Install dependencies
uses: taiki-e/install-action@v2
with:
tool: cargo-binstall
tool: cargo-hack, cargo-minimal-versions, cargo-binstall

- name: Install cargo-msrv
run: cargo binstall --version 0.16.0-beta.20 --no-confirm cargo-msrv
run: cargo binstall --version 0.16.0-beta.22 --no-confirm cargo-msrv

# TODO: Revert to this, once https://github.com/foresterre/cargo-msrv/issues/936 is fixed.
# - name: Check with minimal versions
# # To find out the current MSRV, remove the `rust-version` entry from `Cargo.toml` and run:
# # run: cargo minimal-versions msrv --output-format json --all-features --target=thumbv7em-none-eabihf --log-target=stdout --log-level debug
# run: cargo minimal-versions msrv --output-format json --all-features --target thumbv7em-none-eabihf verify

#- uses: Swatinem/rust-cache@v1
# WORKAROUND:
- name: Determine MSRV
run: echo "MSRV=$(cargo msrv show --output-format=minimal)" >> $GITHUB_ENV

- name: Check MSRV
#run: cargo msrv --output-format json --all-features --target=thumbv7em-none-eabihf -- cargo check --examples
#run: cargo msrv --log-target=stdout --log-level debug --output-format json --all-features --target=thumbv7em-none-eabihf verify -- cargo check --examples
run: cargo msrv --output-format json --all-features --target=thumbv7em-none-eabihf verify -- cargo check --examples
- name: Show MSRV
run: echo $MSRV

- name: Install MSRV Rust version
run: rustup toolchain install $MSRV --target thumbv7em-none-eabihf

- name: Check with minimal versions
run: cargo +${MSRV} minimal-versions check --target thumbv7em-none-eabihf --all-features

semver:
name: Semantic Versioning
Expand All @@ -118,76 +131,14 @@ jobs:
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
feature-group: all-features

min-versions:
name: Minimal Dependency Versions
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
targets: thumbv7em-none-eabihf

- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Install cargo-minimal-versions
uses: taiki-e/install-action@cargo-minimal-versions

- name: Check with minimal versions
run: cargo minimal-versions check --all-features --workspace --ignore-private

- name: Build examples with minimal versions
run: cargo minimal-versions build --all-features --examples

min-versions-msrv:
name: Minimal Dependency Versions (MSRV)
runs-on: ubuntu-latest
needs: [lints, docs]
env:
RUSTFLAGS: "-D warnings"
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
targets: thumbv7em-none-eabihf

- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cargo-msrv
run: cargo binstall --version 0.16.0-beta.20 --no-confirm cargo-msrv
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Install cargo-minimal-versions
uses: taiki-e/install-action@cargo-minimal-versions

- name: Determine MSRV
run: echo "MSRV=$(cargo msrv show --output-format=minimal)" >> $GITHUB_ENV

- name: Show MSRV
run: echo $MSRV

- name: Install MSRV Rust version
run: rustup toolchain install $MSRV

- name: Check with minimal versions
run: cargo +$MSRV minimal-versions check --all-features --workspace --ignore-private

- name: Build examples with minimal versions
run: cargo +$MSRV minimal-versions build --all-features --examples
feature-group: "all-features"

release:
name: Publish version
runs-on: ubuntu-latest
environment: production
if: github.event_name == 'release'
needs: [build_examples, build_examples_release, lints, docs, msrv, semver, min-versions, min-versions-msrv]
needs: [build_examples, build_examples_release, lints, docs, msrv, semver]
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand Down

0 comments on commit d454d1e

Please sign in to comment.