Skip to content

Commit aef08ca

Browse files
mockersfalradish
authored andcommitted
add rust-version for MSRV and CI job to check (bevyengine#6852)
# Objective - Fixes bevyengine#6777, fixes bevyengine#2998, replaces bevyengine#5518 - Help avoid confusing error message when using an older version of Rust ## Solution - Add the `rust-version` field to `Cargo.toml` - Add a CI job checking the MSRV - Add the job to bors
1 parent 356da61 commit aef08ca

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

.github/bors.toml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ status = [
1717
"build-without-default-features (bevy)",
1818
"build-without-default-features (bevy_ecs)",
1919
"build-without-default-features (bevy_reflect)",
20+
"msrv",
2021
]
2122

2223
use_squash_merge = true

.github/workflows/ci.yml

+26
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,29 @@ jobs:
275275
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
276276
- name: Run cargo udeps
277277
run: cargo udeps
278+
279+
msrv:
280+
runs-on: ubuntu-latest
281+
needs: build
282+
steps:
283+
- uses: actions/checkout@v3
284+
- uses: actions/cache@v3
285+
with:
286+
path: |
287+
~/.cargo/bin/
288+
~/.cargo/registry/index/
289+
~/.cargo/registry/cache/
290+
~/.cargo/git/db/
291+
target/
292+
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.toml') }}
293+
- name: get MSRV
294+
run: |
295+
msrv=`cargo metadata --no-deps --format-version 1 | jq --raw-output '.packages[] | select(.name=="bevy") | .rust_version'`
296+
echo "MSRV=$msrv" >> $GITHUB_ENV
297+
- uses: dtolnay/rust-toolchain@master
298+
with:
299+
toolchain: ${{ env.MSRV }}
300+
- name: Install alsa and udev
301+
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
302+
- name: Run cargo check
303+
run: cargo check

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ keywords = ["game", "engine", "gamedev", "graphics", "bevy"]
1010
license = "MIT OR Apache-2.0"
1111
readme = "README.md"
1212
repository = "https://github.com/bevyengine/bevy"
13+
rust-version = "1.66.0"
1314

1415
[workspace]
1516
exclude = ["benches", "crates/bevy_ecs_compile_fail_tests", "crates/bevy_reflect_compile_fail_tests"]

0 commit comments

Comments
 (0)