Skip to content

Commit 6a341bc

Browse files
committed
build: new msrv job to isolate build tools
The msrv job checks just that the library code can be built with the MSRV's compiler, and that is it. All other build tooling functionallity doesn't need to be gated on the MSRV since it doesn't effect consumers. We specifically would rather use cargo's V3 resolver by default to generate our lockfiles.
1 parent f1a6f0e commit 6a341bc

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
platform: [ubuntu-latest, macos-latest, windows-latest]
14-
# Minumum Supported Rust Version (MSRV) is 1.63.0.
15-
toolchain: [1.63.0, stable, beta, nightly]
16-
include:
17-
- toolchain: 1.63.0
18-
msrv: true
14+
toolchain: [stable, beta, nightly]
1915
runs-on: ${{ matrix.platform }}
2016
steps:
2117
- uses: actions/checkout@v3
@@ -25,25 +21,40 @@ jobs:
2521
rustup component add --toolchain ${{ matrix.toolchain }} rustfmt
2622
rustup component add --toolchain ${{ matrix.toolchain }} clippy
2723
rustup update ${{ matrix.toolchain }}
28-
# - name: Pin dependencies
29-
# if: matrix.msrv
30-
# run: cargo update -p allocator-api2 --precise "0.2.9" --verbose
3124
- name: Lint all targets
32-
if: ${{ !matrix.msrv }}
3325
run: cargo clippy --all-targets
3426
- name: Format
35-
if: ${{ !matrix.msrv }}
3627
run: cargo fmt -- --check
3728
- name: Build with defeault features
3829
run: cargo build --verbose
3930
- name: Check release build on Rust ${{ matrix.toolchain }}
4031
run: cargo check --release --verbose --color always
4132
- name: Unit test
42-
if: ${{ !matrix.msrv }}
4333
run: cargo test --verbose --lib
4434
- name: Doc test
45-
if: ${{ !matrix.msrv }}
4635
run: cargo test --verbose --doc
36+
# Check that library code can be compiled with MSRV (1.63.0).
37+
msrv:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v3
41+
# Modify build tools just for MSRV testing. This avoids us having
42+
# to bump our MSRV just for tooling. Tooling doesn't effect consumers so not a risk.
43+
- name: Prepare environment for MSRV toolchain
44+
run: |
45+
# Remove resolver = "3" line for MSRV compatibility. We use V3 to
46+
# generate an MSRV-compliant lockfile, but this isn't necessary to
47+
# check if library code is MSRV compliant. Any resolver can go
48+
# and grab the versions specified in the committed lockfile.
49+
#
50+
# The V3 resolver is standard in rust 1.85.
51+
sed -i '/resolver = "3"/d' Cargo.toml
52+
- name: Install MSRV toolchain
53+
run: |
54+
rustup toolchain install 1.63.0
55+
rustup default 1.63.0
56+
- name: Build with MSRV compiler
57+
run: cargo build --verbose
4758
signet:
4859
runs-on: ubuntu-latest
4960
steps:

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ repository = "https://github.com/rustaceanrob/kyoto"
99
readme = "README.md"
1010
keywords = ["bitcoin", "cryptography", "network", "peer-to-peer"]
1111
categories = ["cryptography::cryptocurrencies"]
12-
resolver = "2"
12+
# MSRV-aware resolver which is the default in edition2024.
13+
resolver = "3"
1314

1415
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1516

0 commit comments

Comments
 (0)