Skip to content
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

Add script to check rust versions + cleanup #272

Merged
merged 17 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ on:
types: [opened, reopened, synchronize]

jobs:
version:
name: check rust versions match expected version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
profile: minimal
override: true
- name: check rust versions
run: ./scripts/check-rust-version.sh

rustfmt:
name: rustfmt nightly on ubuntu-latest
runs-on: ubuntu-latest
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Generated by Cargo

# will have compiled files and executables
debug/
target/

# Generated by protox `file_descriptor_set.bin`
*.bin

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
# Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
"test-macro",
]
resolver = "2"
rust-version = "1.75"
bobbinth marked this conversation as resolved.
Show resolved Hide resolved

[workspace.dependencies]
miden-crypto = { version = "0.8" }
Expand Down
2 changes: 1 addition & 1 deletion block-producer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-node"
keywords = ["miden", "node", "program", "store"]
edition = "2021"
rust-version = "1.73"
rust-version = "1.75"

[[bin]]
name = "miden-node-block-producer"
Expand Down
2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-node"
keywords = ["miden", "node", "program"]
edition = "2021"
rust-version = "1.73"
rust-version = "1.75"

[features]
# Makes `make-genesis` subcommand run faster. Is only suitable for testing.
Expand Down
2 changes: 1 addition & 1 deletion proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-node"
keywords = ["miden", "node", "program", "proto"]
edition = "2021"
rust-version = "1.73"
rust-version = "1.75"

[dependencies]
hex = { version = "0.4" }
Expand Down
2 changes: 1 addition & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-node"
keywords = ["miden", "node", "program", "rpc"]
edition = "2021"
rust-version = "1.73"
rust-version = "1.75"

[dependencies]
anyhow = { version = "1.0" }
Expand Down
22 changes: 22 additions & 0 deletions scripts/check-rust-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Define the expected Rust version
EXPECTED_VERSION="1.75"
phklive marked this conversation as resolved.
Show resolved Hide resolved

# Check rust-toolchain file
TOOLCHAIN_VERSION=$(cat rust-toolchain)
if [ "$TOOLCHAIN_VERSION" != "$EXPECTED_VERSION" ]; then
echo "Mismatch in rust-toolchain. Expected $EXPECTED_VERSION, found $TOOLCHAIN_VERSION"
exit 1
fi

# Check each Cargo.toml file
for file in $(find . -name Cargo.toml); do
CARGO_VERSION=$(grep "rust-version" $file | cut -d '"' -f 2)
if [ "$CARGO_VERSION" != "$EXPECTED_VERSION" ]; then
echo "Mismatch in $file. Expected $EXPECTED_VERSION, found $CARGO_VERSION"
exit 1
fi
done

echo "All rust versions match ✅"
2 changes: 1 addition & 1 deletion store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-node"
keywords = ["miden", "node", "program", "store"]
edition = "2021"
rust-version = "1.73"
rust-version = "1.75"

[[bin]]
name = "miden-node-store"
Expand Down
2 changes: 1 addition & 1 deletion test-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-node"
keywords = ["miden", "node", "utils", "macro"]
edition = "2021"
rust-version = "1.73"
rust-version = "1.75"

[dependencies]
quote = { version = "1.0" }
Expand Down
2 changes: 1 addition & 1 deletion utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT"
repository = "https://github.com/0xPolygonMiden/miden-node"
keywords = ["miden", "node", "utils"]
edition = "2021"
rust-version = "1.73"
rust-version = "1.75"

[dependencies]
anyhow = { version = "1.0" }
Expand Down
Loading