build!: bump rust to 1.76 and add rust update script#1693
Conversation
| # The same as in /README.md | ||
| default: "stable" | ||
| # Update using scripts/update-rust-toolchain.sh | ||
| default: "1.76" |
There was a problem hiding this comment.
Isn't it's using toolchain file if not set?
| description: Enable Rust cache | ||
| required: false | ||
| default: "true" | ||
|
|
There was a problem hiding this comment.
Why did you remove new lines? I see it more readable rather then on block of test
There was a problem hiding this comment.
That's what yq tool did that I use to replace version in yaml.
I can try to refactor to use multi-line sed if you wish.
There was a problem hiding this comment.
Oh, you dynamically update it...
There was a problem hiding this comment.
Maybe just read it from the toolchain file instead of hardcoding?
Suggestion from ChatGPT:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Checkout your repository
- name: Extract Rust toolchain version
id: rust_toolchain
run: |
TOOLCHAIN_VERSION=$(grep channel rust-toolchain.toml | awk '{print $3}' | tr -d '"')
echo "TOOLCHAIN_VERSION=$TOOLCHAIN_VERSION" >> $GITHUB_ENV
echo "::set-output name=version::$TOOLCHAIN_VERSION"
# This command reads the rust-toolchain.toml, extracts the version, and sets it as an environment variable and step output
# Use the extracted version in subsequent steps
- name: Use Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ steps.rust_toolchain.outputs.version }}
override: true
I would use $GITHUB_OUTPUT though
| edition = "2021" | ||
| rust-version = "1.73" | ||
| # Update using scripts/update-rust-toolchain.sh | ||
| rust-version = "1.76" |
There was a problem hiding this comment.
I don't understand the question.
The rust-version field is an optional key that tells cargo what version of the Rust language and compiler your package can be compiled with.
As we only test on 1.76, we only support this version onwards.
There was a problem hiding this comment.
Yeah, I've never seen such an option, and since it's a minimal value then it's all good.
| @@ -0,0 +1,20 @@ | |||
| use std::fmt::Display; | |||
There was a problem hiding this comment.
yes, good point, missed this.
Will remove.
| description: Enable Rust cache | ||
| required: false | ||
| default: "true" | ||
|
|
There was a problem hiding this comment.
Maybe just read it from the toolchain file instead of hardcoding?
Suggestion from ChatGPT:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Checkout your repository
- name: Extract Rust toolchain version
id: rust_toolchain
run: |
TOOLCHAIN_VERSION=$(grep channel rust-toolchain.toml | awk '{print $3}' | tr -d '"')
echo "TOOLCHAIN_VERSION=$TOOLCHAIN_VERSION" >> $GITHUB_ENV
echo "::set-output name=version::$TOOLCHAIN_VERSION"
# This command reads the rust-toolchain.toml, extracts the version, and sets it as an environment variable and step output
# Use the extracted version in subsequent steps
- name: Use Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ steps.rust_toolchain.outputs.version }}
override: true
I would use $GITHUB_OUTPUT though
|
Superseded by #2070 |
Issue being fixed or feature implemented
New Rust was released
What was done?
How Has This Been Tested?
Run script locally + Github Actions
Breaking Changes
New Rust version 1.76 is required
Checklist:
For repository code-owners and collaborators only