Skip to content

ci(template): Use pinned rustup version #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ rust_nightly_version: nightly-2025-01-15
# be kept in line with the edition in the operator-rs repository.
rust_edition: 2024

# This value is used to pin (possible since https://github.com/rust-lang/rustup/pull/4259) the
# rustup version used in CI because rustup introduced multiple breaking changes in the past, see:
# - https://github.com/rust-lang/rustup/issues/4211
# - https://github.com/rust-lang/rustup/issues/4337
# Check for new versions here: https://github.com/rust-lang/rustup/tags
rustup_version: 1.28.1

# IMPORTANT
# If you change the Hadolint version here, make sure to also change the hook
# refs in the local and templated .pre-commit-config.yaml files.
Expand Down
8 changes: 8 additions & 0 deletions template/.github/workflows/build.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ env:
CARGO_PROFILE_DEV_DEBUG: '0'
RUST_TOOLCHAIN_VERSION: "{[ rust_version }]"
RUST_NIGHTLY_TOOLCHAIN_VERSION: "{[ rust_nightly_version }]"
RUSTUP_VERSION: "{[ rustup_version }]"
PYTHON_VERSION: "{[ python_version }]"
RUSTFLAGS: "-D warnings"
RUSTDOCFLAGS: "-D warnings"
Expand All @@ -53,6 +54,7 @@ jobs:
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
rustup-version: ${{ env.RUSTUP_VERSION }}
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
with:
key: udeps
Expand Down Expand Up @@ -129,6 +131,7 @@ jobs:
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
with:
toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN_VERSION }}
rustup-version: ${{ env.RUSTUP_VERSION }}
components: rustfmt
- env:
RUST_TOOLCHAIN_VERSION: ${{ env.RUST_NIGHTLY_TOOLCHAIN_VERSION }}
Expand All @@ -150,6 +153,7 @@ jobs:
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
rustup-version: ${{ env.RUSTUP_VERSION }}
components: clippy
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
with:
Expand Down Expand Up @@ -188,6 +192,7 @@ jobs:
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
rustup-version: ${{ env.RUSTUP_VERSION }}
components: rustfmt
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
with:
Expand All @@ -212,6 +217,7 @@ jobs:
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
rustup-version: ${{ env.RUSTUP_VERSION }}
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
with:
key: test
Expand Down Expand Up @@ -277,6 +283,7 @@ jobs:
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
rustup-version: ${{ env.RUSTUP_VERSION }}
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
with:
key: charts
Expand Down Expand Up @@ -344,6 +351,7 @@ jobs:
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
rustup-version: ${{ env.RUSTUP_VERSION }}
components: rustfmt
# This step checks if the current run was triggered by a push to a pr (or a pr being created).
# If this is the case it changes the version of this project in all Cargo.toml files to include the suffix
Expand Down
2 changes: 2 additions & 0 deletions template/.github/workflows/pr_pre-commit.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
NIX_PKG_MANAGER_VERSION: "{[ nix_pkg_manager_version }]"
RUST_TOOLCHAIN_VERSION: "{[ rust_nightly_version }]"
HADOLINT_VERSION: "{[ hadolint_version }]"
RUSTUP_VERSION: "{[ rustup_version }]"
PYTHON_VERSION: "{[ python_version }]"

jobs:
Expand All @@ -30,6 +31,7 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}
rust: ${{ env.RUST_TOOLCHAIN_VERSION }}
rustup-version: ${{ env.RUSTUP_VERSION }}
hadolint: ${{ env.HADOLINT_VERSION }}
nix: ${{ env.NIX_PKG_MANAGER_VERSION }}
nix-github-token: ${{ secrets.GITHUB_TOKEN }}