Skip to content

Commit 061cc5e

Browse files
nyurikpvdrz
authored andcommitted
automate MSRV in CI
1 parent e55cc8d commit 061cc5e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

.github/workflows/bindgen.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@ jobs:
3737
steps:
3838
- uses: actions/checkout@v4
3939

40+
- name: Read crate metadata
41+
id: metadata
42+
run: echo "rust-version=$(sed -ne 's/rust-version *= *\"\(.*\)\"/\1/p' Cargo.toml)" >> $GITHUB_OUTPUT
43+
4044
- name: Install msrv for lib
4145
uses: dtolnay/rust-toolchain@master
4246
with:
43-
# MSRV below is documented in Cargo.toml and README.md, please update those if you
44-
# change this.
45-
toolchain: 1.70.0
47+
toolchain: ${{ steps.metadata.outputs.rust-version }}
4648

4749
- name: Test lib with msrv
48-
run: cargo +1.70.0 test --package bindgen
50+
run: cargo +${{ steps.metadata.outputs.rust-version }} test --package bindgen
4951

5052
- name: Install msrv for cli
5153
uses: dtolnay/rust-toolchain@master
5254
with:
53-
# MSRV below is documented in Cargo.toml and README.md, please update those if you
54-
# change this.
55-
toolchain: 1.70.0
55+
toolchain: ${{ steps.metadata.outputs.rust-version }}
5656

5757
- name: Test cli with msrv
58-
run: cargo +1.70.0 build --package bindgen-cli
58+
run: cargo +${{ steps.metadata.outputs.rust-version }} build --package bindgen-cli
5959

6060
minimal:
6161
runs-on: ubuntu-latest

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ default-members = [
1515
]
1616

1717
[workspace.package]
18-
# If you change this, also update README.md and msrv in .github/workflows/bindgen.yml
18+
# If you change this, also update README.md
1919
rust-version = "1.70.0"
2020
edition = "2021"
2121

0 commit comments

Comments
 (0)