diff --git a/.github/ci/rust_version.txt b/.github/ci/rust_version.txt new file mode 100644 index 00000000..e0d0da1a --- /dev/null +++ b/.github/ci/rust_version.txt @@ -0,0 +1 @@ +1.91.0 \ No newline at end of file diff --git a/.github/workflows/build_releases.yml b/.github/workflows/build_releases.yml index 061ef4db..8d1e946b 100644 --- a/.github/workflows/build_releases.yml +++ b/.github/workflows/build_releases.yml @@ -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? diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3630ab3a..d5a4f5cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0c3d62c7..d780e7ec 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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 diff --git a/Cargo.toml b/Cargo.toml index 9efe9b71..3d579dfe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,6 @@ exclude = [ "codecov.yml", "CONTRIBUTING.md", "Cross.toml", - "rust-toolchain.toml", "rustfmt.toml", ] edition = "2021"