Skip to content

Commit b95d49e

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 b95d49e

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

.github/workflows/ci.yml

Lines changed: 19 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,36 @@ 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.
42+
# This avoids us having to bump our MSRV just for tooling. Tooling
43+
# doesn't effect consumers so not a risk.
44+
- name: Prepare build for MSRV
45+
run: |
46+
# Remove resolver = "3" line for MSRV compatibility, standard in rust 1.85.
47+
sed -i '/resolver = "3"/d' Cargo.toml
48+
- name: Install MSRV toolchain
49+
run: |
50+
rustup toolchain install 1.63.0
51+
rustup default 1.63.0
52+
- name: Build with MSRV compiler
53+
run: cargo build --verbose
4754
signet:
4855
runs-on: ubuntu-latest
4956
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)