Skip to content

Commit 4e0aa33

Browse files
committed
meta: Set a MSRV of 1.65 and test it in CI
This is about the oldest version I was able to successfully build for without needing changes. We could bump it easily if needed. Since we are checking the build at this old version, there isn't really a need to test with both stable and beta. Delete these from the matrix so we are only testing on nightly, which will let us use unstable features when needed.
1 parent b68b896 commit 4e0aa33

2 files changed

Lines changed: 23 additions & 9 deletions

File tree

.github/workflows/main.yaml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,43 @@ jobs:
1717
timeout-minutes: 20
1818
strategy:
1919
matrix:
20-
build: [stable, beta, nightly]
2120
include:
22-
- build: stable
23-
os: ubuntu-24.04
24-
rust: stable
25-
- build: beta
26-
os: ubuntu-24.04
27-
rust: beta
2821
- build: nightly
2922
os: ubuntu-24.04
3023
rust: nightly
3124
steps:
3225
- uses: actions/checkout@v6
3326
- name: Install Rust
34-
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
27+
run: rustup update nightly --no-self-update && rustup default nightly
3528
- name: Build and run tests
3629
run: cargo test
3730

31+
msrv:
32+
name: Check the MSRV
33+
runs-on: ubuntu-24.04
34+
timeout-minutes: 20
35+
env:
36+
RUSTFLAGS: # No need to check warnings on old MSRV, unset `-Dwarnings`
37+
steps:
38+
- uses: actions/checkout@v6
39+
- run: |
40+
msrv="$(
41+
cargo metadata --no-deps --format-version 1 |
42+
jq -r '.packages .[] | | select(.name == "rustc_apfloat") | .rust_version'
43+
)"
44+
echo "MSRV: $msrv"
45+
echo "MSRV=$msrv" >> "$GITHUB_ENV"
46+
- name: Install Rust
47+
run: rustup update "$MSRV" --no-self-update && rustup default "$MSRV"
48+
- uses: Swatinem/rust-cache@v2
49+
- run: cargo build --package rustc_apfloat
50+
3851
rustfmt:
3952
name: Rustfmt
4053
runs-on: ubuntu-24.04
4154
timeout-minutes: 10
4255
steps:
4356
- uses: actions/checkout@v6
4457
- name: Install Rust
45-
run: rustup update stable && rustup default stable && rustup component add rustfmt
58+
run: rustup update stable --no-self-update && rustup default stable && rustup component add rustfmt
4659
- run: cargo fmt --check

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ edition.workspace = true
1313
license.workspace = true
1414
repository = "https://github.com/rust-lang/rustc_apfloat"
1515
description = "Rust port of C++ llvm::APFloat library"
16+
rust-version = "1.65.0"
1617
exclude = [".github/"]
1718

1819
[dependencies]

0 commit comments

Comments
 (0)