Skip to content

Commit

Permalink
Introduce dedicated minimum supported Rust version job
Browse files Browse the repository at this point in the history
Introduce a dedicated CI job for checking that the program builds with
the advertised minimum supported Rust version. One problem that we have
with the existing check is that it builds the entire crate, including
all tests and other development artifacts. But we don't really care
whether anything development related adheres to our MSRV -- only the
main program and core extensions.
  • Loading branch information
d-e-s-o committed Oct 7, 2024
1 parent e9b3e65 commit 51f082a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [1.56.1, stable, beta, nightly]
rust: [stable, beta, nightly]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
Expand All @@ -40,6 +40,23 @@ jobs:
- run: cargo build --workspace --bins --tests --verbose --release
- run: cargo test --workspace --verbose

build-minimum:
name: Build with minimum supported Rust version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get install libhidapi-dev
- name: Install Nightly Rust
uses: dtolnay/rust-toolchain@nightly
- run: cargo +nightly -Z minimal-versions update
- name: Install minimum Rust
uses: dtolnay/rust-toolchain@master
with:
# Please adjust README file when bumping version.
toolchain: 1.56.1
- name: Build
run: cargo build --bins --locked

clippy:
name: Lint with clippy
runs-on: ubuntu-latest
Expand Down
14 changes: 11 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
name = "nitrocli"
version = "0.4.1"
edition = "2021"
rust-version = "1.56"
authors = ["Daniel Mueller <[email protected]>"]
license = "GPL-3.0-or-later"
homepage = "https://github.com/d-e-s-o/nitrocli"
Expand Down Expand Up @@ -63,7 +64,7 @@ version = "0.9.0"
version = "3.0.2"

[dependencies.serde]
version = "1.0"
version = "1.0.103"
features = ["derive"]

[dependencies.structopt]
Expand All @@ -87,3 +88,12 @@ version = "1"

[dev-dependencies.tempfile]
version = "3.1"

[dev-dependencies]
# A set of unused dependencies that we require to force correct minimum versions
# of transitive dependencies, for cases where our dependencies have incorrect
# dependency specifications themselves.
# error: cannot find macro `log` in this scope
_log_unused = { package = "log", version = "0.4.4" }
# error[E0635]: unknown feature `proc_macro_span_shrink`
_proc_macro2_unused = { package = "proc-macro2", version = "1.0.60" }

0 comments on commit 51f082a

Please sign in to comment.