add rust-version for MSRV and CI job to check (#6852)
# Objective - Fixes #6777, fixes #2998, replaces #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
This commit is contained in:
parent
afe0a0650b
commit
7df680bb0a
1
.github/bors.toml
vendored
1
.github/bors.toml
vendored
@ -17,6 +17,7 @@ status = [
|
|||||||
"build-without-default-features (bevy)",
|
"build-without-default-features (bevy)",
|
||||||
"build-without-default-features (bevy_ecs)",
|
"build-without-default-features (bevy_ecs)",
|
||||||
"build-without-default-features (bevy_reflect)",
|
"build-without-default-features (bevy_reflect)",
|
||||||
|
"msrv",
|
||||||
]
|
]
|
||||||
|
|
||||||
use_squash_merge = true
|
use_squash_merge = true
|
||||||
|
|||||||
26
.github/workflows/ci.yml
vendored
26
.github/workflows/ci.yml
vendored
@ -275,3 +275,29 @@ jobs:
|
|||||||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
|
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
|
||||||
- name: Run cargo udeps
|
- name: Run cargo udeps
|
||||||
run: cargo udeps
|
run: cargo udeps
|
||||||
|
|
||||||
|
msrv:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/bin/
|
||||||
|
~/.cargo/registry/index/
|
||||||
|
~/.cargo/registry/cache/
|
||||||
|
~/.cargo/git/db/
|
||||||
|
target/
|
||||||
|
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.toml') }}
|
||||||
|
- name: get MSRV
|
||||||
|
run: |
|
||||||
|
msrv=`cargo metadata --no-deps --format-version 1 | jq --raw-output '.packages[] | select(.name=="bevy") | .rust_version'`
|
||||||
|
echo "MSRV=$msrv" >> $GITHUB_ENV
|
||||||
|
- uses: dtolnay/rust-toolchain@master
|
||||||
|
with:
|
||||||
|
toolchain: ${{ env.MSRV }}
|
||||||
|
- name: Install alsa and udev
|
||||||
|
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
|
||||||
|
- name: Run cargo check
|
||||||
|
run: cargo check
|
||||||
|
|||||||
@ -10,6 +10,7 @@ keywords = ["game", "engine", "gamedev", "graphics", "bevy"]
|
|||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
repository = "https://github.com/bevyengine/bevy"
|
repository = "https://github.com/bevyengine/bevy"
|
||||||
|
rust-version = "1.66.0"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
exclude = ["benches", "crates/bevy_ecs_compile_fail_tests", "crates/bevy_reflect_compile_fail_tests"]
|
exclude = ["benches", "crates/bevy_ecs_compile_fail_tests", "crates/bevy_reflect_compile_fail_tests"]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user