Skip to content

Commit

Permalink
Add proper CI job for building with minimum dependency versions
Browse files Browse the repository at this point in the history
We have repeatedly been impacted by more recent versions of dependencies
requiring more recent versions of Rust in our CI workflow that tests
building with the minimum supported Rust version. That is mostly the
case because we do not lock our dependent versions via a Cargo.lock
file.
In order to prevent any issues from this setup, this change introduces a
proper CI job that makes sure to compile against the minimum versions of
dependencies with the minimum Rust version we support.
  • Loading branch information
d-e-s-o committed Nov 21, 2023
1 parent 0645763 commit 9ee5184
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ env:

jobs:
test:
name: Build and test [${{ matrix.rust }}, ${{ matrix.profile }}]
name: Build and test [${{ matrix.profile }}]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [1.60.0, stable]
rust: [stable]
profile: [dev, release]
steps:
- uses: actions/checkout@v3
Expand All @@ -38,6 +38,27 @@ jobs:
run: |
cargo build --profile=${{ matrix.profile }} --bins
cargo test --profile=${{ matrix.profile }}
build-minimum:
name: Build using minimum versions of dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nightly Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
- run: cargo +nightly -Z minimal-versions update
- name: Install minimum Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
# Please adjust README and rust-version field in Cargo.toml files when
# bumping version.
toolchain: 1.60.0
default: true
- name: Build
run: cargo build --features=vendored-openssl --locked
clippy:
name: Lint with clippy
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,10 @@ tracing = {version = "0.1", default-features = false, features = ["std"]}
tracing-subscriber = {version = "0.3", default-features = false, features = ["ansi", "env-filter", "fmt"]}
uuid = {version = "1.0", features = ["v4"]}
yansi = {version = "0.5", default-features = false}

[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.
_rustc_version_unused = { package = "rustc_version", version = "0.2.2" }
_num_bigint_unused = { package = "num-bigint", version = "0.4.2" }

0 comments on commit 9ee5184

Please sign in to comment.