ci: pin Rust version in CI to file (#1845)

* set the CI version to be pinned in jobs instead

* pin it to a file

* .txt

* quotes?

* todo

* bash?
This commit is contained in:
Clement Tsang
2025-11-02 10:30:15 -05:00
committed by GitHub
parent 8d06d729db
commit 49ee330116
5 changed files with 51 additions and 8 deletions
+1
View File
@@ -0,0 +1 @@
1.91.0
+29 -4
View File
@@ -135,11 +135,18 @@ jobs:
with:
fetch-depth: 1
# TODO: Make this and the toolchain step a separate wrapper action?
- name: Read Rust version
shell: bash
run: |
VER=$(cat .github/ci/rust_version.txt)
echo "RUST_VERSION=$VER" >> $GITHUB_ENV
- name: Set up Rust toolchain
if: matrix.info.container == ''
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: ${{ matrix.info.rust || 'stable' }}
toolchain: ${{ matrix.info.rust || env.RUST_VERSION }}
target: ${{ matrix.info.target }}
- name: Set up Rust toolchain (non-GitHub container)
@@ -338,10 +345,16 @@ jobs:
run: |
choco install -y wixtoolset --no-progress;
- name: Read Rust version
shell: bash
run: |
VER=$(cat .github/ci/rust_version.txt)
echo "RUST_VERSION=$VER" >> $GITHUB_ENV
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: stable
toolchain: ${{ env.RUST_VERSION }}
target: ${{ matrix.info.target }}
- name: Install cargo-wix
@@ -456,10 +469,16 @@ jobs:
with:
fetch-depth: 1
- name: Read Rust version
shell: bash
run: |
VER=$(cat .github/ci/rust_version.txt)
echo "RUST_VERSION=$VER" >> $GITHUB_ENV
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: ${{ matrix.info.rust || 'stable' }}
toolchain: ${{ matrix.info.rust || env.RUST_VERSION }}
target: ${{ matrix.info.target }}
# TODO: Could I use the previous jobs to skip this call?
@@ -560,10 +579,16 @@ jobs:
with:
fetch-depth: 1
- name: Read Rust version
shell: bash
run: |
VER=$(cat .github/ci/rust_version.txt)
echo "RUST_VERSION=$VER" >> $GITHUB_ENV
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: ${{ matrix.info.rust || 'stable' }}
toolchain: ${{ matrix.info.rust || env.RUST_VERSION }}
target: ${{ matrix.info.target }}
# TODO: Could I use the previous jobs to skip this call?
+14 -2
View File
@@ -85,10 +85,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Read Rust version
shell: bash
run: |
VER=$(cat .github/ci/rust_version.txt)
echo "RUST_VERSION=$VER" >> $GITHUB_ENV
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: stable
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt, clippy
target: ${{ matrix.info.target }}
@@ -239,10 +245,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Read Rust version
shell: bash
run: |
VER=$(cat .github/ci/rust_version.txt)
echo "RUST_VERSION=$VER" >> $GITHUB_ENV
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: ${{ matrix.info.rust || 'stable' }}
toolchain: ${{ matrix.info.rust || env.RUST_VERSION }}
target: ${{ matrix.info.target }}
components: "clippy"
+7 -1
View File
@@ -49,10 +49,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Read Rust version
shell: bash
run: |
VER=$(cat .github/ci/rust_version.txt)
echo "RUST_VERSION=$VER" >> $GITHUB_ENV
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: stable
toolchain: ${{ env.RUST_VERSION }}
- name: Enable Rust cache
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # 2.8.1
-1
View File
@@ -33,7 +33,6 @@ exclude = [
"codecov.yml",
"CONTRIBUTING.md",
"Cross.toml",
"rust-toolchain.toml",
"rustfmt.toml",
]
edition = "2021"