chore(ci): enforce msrv in parts of our CI. (#4879)

closes #4874 


![image](https://github.com/user-attachments/assets/98c2650d-54dd-45d9-82ee-0516339ae1f8)
This commit is contained in:
rzvxa 2024-08-13 17:17:28 +03:30 committed by GitHub
parent 81fd6379e8
commit a9c729a197
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -67,7 +67,12 @@ jobs:
RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup
shell: bash
run: |
sed -i -e 's/profile = "default"/profile = "minimal"/g' rust-toolchain.toml
# This `awk` command will find the value of our Minimum Supported Rust Version and store it as `MSRV`.
# NOTE: this will fail if there are any other items named `rust-version`. We assume there is only one in our `Cargo.toml`.
MSRV=$(awk -F'=' '/rust-version/ {gsub(/[" ]/, "", $2); printf "%s", ($2 + "")}' Cargo.toml)
# Set profile to minimal and channel to our Minimum Supported Rust Version.
# Running our tests on this channel ensures that our code uses APIs that are supported in our `MSRV`.
sed -i -e 's/profile = "default"/profile = "minimal"/g' -e "s/channel = .*/channel = \"$MSRV\"/g" rust-toolchain.toml
rustup set profile minimal
rustup show
git restore .