Skip to content

Commit 6f50a2d

Browse files
committed
CI: Centralize Rust version management using RUST_STABLE_VERSION
Define RUST_STABLE_VERSION environment variable in CI workflows and use it consistently instead of hardcoded version numbers. This improves maintainability by ensuring all workflows reference a single source of truth for the Rust stable version. Changes: - Added RUST_STABLE_VERSION env var to build-reusable.yaml, tests.yaml, lint.yaml, and doc-commands.yaml - Replaced all hardcoded "1.84" references with env variable references - Added cross-reference comments to track related version definitions across rust-toolchain.toml, CI workflows, and documentation This ensures version consistency and simplifies future Rust version updates across the entire CI infrastructure.
1 parent 1185530 commit 6f50a2d

File tree

5 files changed

+49
-9
lines changed

5 files changed

+49
-9
lines changed

.github/workflows/build-reusable.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ env:
3434
MINA_PANIC_ON_BUG: true
3535
CARGO_INCREMENTAL: 1
3636
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off"
37+
# This should be in line with the version in:
38+
# - rust-toolchain.toml
39+
# - .github/workflows/build-reusable.yaml
40+
# - .github/workflows/tests.yaml
41+
# - .github/workflows/lint.yaml
42+
# - .github/workflows/doc-commands.yaml
43+
# - website/scripts/setup/install-rust.sh
44+
# - website/docs/developers/getting-started.mdx
45+
RUST_STABLE_VERSION: "1.84"
3746

3847
jobs:
3948
build:
@@ -56,7 +65,7 @@ jobs:
5665
- name: Setup Rust
5766
uses: ./.github/actions/setup-rust
5867
with:
59-
toolchain: 1.84
68+
toolchain: ${{ env.RUST_STABLE_VERSION }}
6069
cache-prefix: build-${{ inputs.os }}-${{ inputs.cache-prefix }}v0
6170

6271
- name: Release build
@@ -99,7 +108,7 @@ jobs:
99108
- name: Setup Rust
100109
uses: ./.github/actions/setup-rust
101110
with:
102-
toolchain: 1.84
111+
toolchain: ${{ env.RUST_STABLE_VERSION }}
103112
cache-prefix: build-tests-${{ inputs.os }}-${{ inputs.cache-prefix }}v0
104113

105114
- name: Build tests
@@ -125,7 +134,7 @@ jobs:
125134
- name: Setup Rust
126135
uses: ./.github/actions/setup-rust
127136
with:
128-
toolchain: 1.84
137+
toolchain: ${{ env.RUST_STABLE_VERSION }}
129138
cache-prefix: build-tests-webrtc-${{ inputs.os }}-${{ inputs.cache-prefix }}v0
130139

131140
- name: Build tests
@@ -152,7 +161,7 @@ jobs:
152161
- name: Setup Rust
153162
uses: ./.github/actions/setup-rust
154163
with:
155-
toolchain: 1.84
164+
toolchain: ${{ env.RUST_STABLE_VERSION }}
156165
cache-prefix: build-${{ inputs.os }}-${{ inputs.cache-prefix }}v0
157166

158167
- name: Build benchmarks

.github/workflows/doc-commands.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ on:
1414
env:
1515
CARGO_TERM_COLOR: always
1616
RUST_BACKTRACE: full
17+
# This should be in line with the version in:
18+
# - rust-toolchain.toml
19+
# - .github/workflows/build-reusable.yaml
20+
# - .github/workflows/tests.yaml
21+
# - .github/workflows/lint.yaml
22+
# - .github/workflows/doc-commands.yaml
23+
# - website/scripts/setup/install-rust.sh
24+
# - website/docs/developers/getting-started.mdx
25+
RUST_STABLE_VERSION: "1.84"
1726

1827
concurrency:
1928
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -36,7 +45,7 @@ jobs:
3645
uses: ./.github/actions/setup-rust
3746
with:
3847
components: rustfmt
39-
toolchain: 1.84
48+
toolchain: ${{ env.RUST_STABLE_VERSION }}
4049
cache-prefix: test-doc-commands-v0
4150

4251
- name: Use shared OCaml setting up steps

.github/workflows/lint.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,26 @@ on:
55
branches: [ main, develop ]
66
pull_request:
77

8+
env:
9+
# This should be in line with the version in:
10+
# - rust-toolchain.toml
11+
# - .github/workflows/build-reusable.yaml
12+
# - .github/workflows/tests.yaml
13+
# - .github/workflows/lint.yaml
14+
# - .github/workflows/doc-commands.yaml
15+
# - website/scripts/setup/install-rust.sh
16+
# - website/docs/developers/getting-started.mdx
17+
RUST_STABLE_VERSION: "1.84"
18+
819
jobs:
920
lint:
1021
timeout-minutes: 10
11-
name: Lint - ${{ matrix.os }} - Rust ${{ matrix.toolchain }}
22+
name: Lint - ${{ matrix.os }} - Rust ${{ env.RUST_STABLE_VERSION }}
1223
runs-on: ${{ matrix.os }}
1324
strategy:
1425
matrix:
1526
ocaml_version: [4.14.2]
1627
os: [ubuntu-24.04]
17-
toolchain: [1.84]
1828
steps:
1929
- uses: actions/checkout@v5
2030
- name: Setup build dependencies
@@ -26,9 +36,9 @@ jobs:
2636
- name: Setup Rust
2737
uses: ./.github/actions/setup-rust
2838
with:
29-
toolchain: ${{ matrix.toolchain }}
39+
toolchain: ${{ env.RUST_STABLE_VERSION }}
3040
components: clippy, rustfmt
31-
cache-prefix: lint-${{ matrix.toolchain }}-v0
41+
cache-prefix: lint-${{ env.RUST_STABLE_VERSION }}-v0
3242
- name: Run make check
3343
run: make check
3444
- name: Run make lint

.github/workflows/tests.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ env:
1717
MINA_PANIC_ON_BUG: true
1818
CARGO_INCREMENTAL: 1
1919
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off"
20+
# This should be in line with the version in:
21+
# - rust-toolchain.toml
22+
# - .github/workflows/build-reusable.yaml
23+
# - .github/workflows/tests.yaml
24+
# - .github/workflows/lint.yaml
25+
# - .github/workflows/doc-commands.yaml
26+
# - website/scripts/setup/install-rust.sh
27+
# - website/docs/developers/getting-started.mdx
2028
RUST_STABLE_VERSION: "1.84"
2129
RUST_NIGHTLY_VERSION: "nightly"
2230
OCAML_VERSION: "4.14.2"

rust-toolchain.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
channel = "1.84"
33

44
# NOTE: When updating the Rust version here, also update:
5+
# - .github/workflows/build-reusable.yaml (RUST_STABLE_VERSION env var)
6+
# - .github/workflows/tests.yaml (RUST_STABLE_VERSION env var)
7+
# - .github/workflows/lint.yaml (RUST_STABLE_VERSION env var)
8+
# - .github/workflows/doc-commands.yaml (RUST_STABLE_VERSION env var)
59
# - website/scripts/setup/install-rust.sh
610
# - website/docs/developers/getting-started.mdx (references the install-rust.sh script)

0 commit comments

Comments
 (0)