Skip to content

Conversation

liferooter
Copy link
Member

@liferooter liferooter commented Sep 23, 2025

  • Introduces justfile as an alternative to existing Makefile and ./scripts/gear.sh.
  • Implements some commonly used Make targets as Just recipes.
  • Replaces usage of ./scripts/gear.sh with usage of Just in some parts of CI.
  • Inline some usages of ./scrpts/gear.sh in CI where there's no need for abstraction into a script.

@liferooter liferooter requested a review from ark0f September 23, 2025 09:52
@liferooter liferooter added the D5-tooling Helper tools and utilities label Sep 23, 2025
Copy link

semanticdiff-com bot commented Sep 23, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  .github/workflows/comparison-table.yml  36% smaller
  .github/workflows/time-consuming-tests.yml  29% smaller
  .github/workflows/check.yml  14% smaller
  .github/actions/install-cargo-extensions/action.yml  0% smaller
  .github/workflows/build-linux.yml  0% smaller
  .github/workflows/build.yml  0% smaller
  .github/workflows/test-measurements.yaml  0% smaller
  just/clippy.just Unsupported file format
  just/ethexe.just Unsupported file format
  just/lib.just Unsupported file format
  justfile Unsupported file format
  shell.nix Unsupported file format

@liferooter liferooter added the A0-pleasereview PR is ready to be reviewed by the team label Sep 23, 2025

- name: "Check clippy"
run: ./scripts/gear.sh clippy gear --all-targets --all-features --locked
run: just clippy native
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its more likely
just clippy :: { workspace ; examples } -> not the point that its wasms
but moreover these steps could be merged into one

- name: "Install: Cargo extensions"
uses: ./.github/actions/install-cargo-extensions

- name: "Show: Versioning"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

such simple commands could be nameless in CI

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other such commands, like "Install: Rust toolchain" or "Install: Foundry" are not nameless.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# Remove untracked files and build caches
[group('actions')]
[confirm('Remove all untracked files and build caches? (y/n)')]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build caches (target dir) are not cleaned

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Target directory is a part of .gitignore so is fully removed by git clean -fdx.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +29 to +37
# Format code via `rustfmt`
[group('actions')]
fmt:
cargo fmt --all

# Check formatting with `rustfmt`
[group('checks')]
fmt-check:
cargo fmt --all --check
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Format code via `rustfmt`
[group('actions')]
fmt:
cargo fmt --all
# Check formatting with `rustfmt`
[group('checks')]
fmt-check:
cargo fmt --all --check
# Format code via `rustfmt`
[group('actions')]
fmt *ARGS:
cargo fmt --all {{ARGS}}


# Check code with `cargo check`
[group('checks')]
check:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed. We always use clippy

Comment on lines +79 to +84
[group('checks')]
test-doc:
# Running documentation tests
__GEAR_WASM_BUILDER_NO_BUILD=1 \
SKIP_WASM_BUILD=1 \
cargo test --doc --workspace --no-fail-fast
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[group('checks')]
test-doc:
# Running documentation tests
__GEAR_WASM_BUILDER_NO_BUILD=1 \
SKIP_WASM_BUILD=1 \
cargo test --doc --workspace --no-fail-fast
[group('checks')]
test-doc $__GEAR_WASM_BUILDER_NO_BUILD="1" $SKIP_WASM_BUILD="1":
cargo test --doc --workspace --no-fail-fast

Comment on lines +62 to +76
test: (ensure-cargo "hack") (ensure-cargo "nextest")
# Running workspace tests
cargo nextest run \
--workspace \
--no-fail-fast \
--exclude gclient \
--exclude gcli \
--exclude gsdk \
--exclude gear-authorship \
--exclude pallet-gear-staking-rewards \
--exclude gear-wasm-gen \
--exclude demo-stack-allocations \
--exclude gring \
--exclude runtime-fuzzer \
--exclude runtime-fuzzer-fuzz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test: (ensure-cargo "hack") (ensure-cargo "nextest")
# Running workspace tests
cargo nextest run \
--workspace \
--no-fail-fast \
--exclude gclient \
--exclude gcli \
--exclude gsdk \
--exclude gear-authorship \
--exclude pallet-gear-staking-rewards \
--exclude gear-wasm-gen \
--exclude demo-stack-allocations \
--exclude gring \
--exclude runtime-fuzzer \
--exclude runtime-fuzzer-fuzz
test *ARGS: (ensure-cargo "hack") (ensure-cargo "nextest")
# Running workspace tests
cargo nextest run --workspace --all-targets --all-features -E 'not package(/fuzz/)' {{ARGS}}

Comment on lines +88 to +95
[group('checks')]
check-runtime-imports:
# Checking runtime imports
cargo build -p wasm-proc
cargo build -p vara-runtime
./target/debug/wasm-proc \
--check-runtime-imports \
target/debug/wbuild/vara-runtime/vara_runtime.wasm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[group('checks')]
check-runtime-imports:
# Checking runtime imports
cargo build -p wasm-proc
cargo build -p vara-runtime
./target/debug/wasm-proc \
--check-runtime-imports \
target/debug/wbuild/vara-runtime/vara_runtime.wasm
[group('checks')]
check-runtime-imports:
# Checking runtime imports
cargo build -p vara-runtime
cargo run -p wasm-proc -- \
--check-runtime-imports \
target/debug/wbuild/vara-runtime/vara_runtime.wasm

# Check all WASM code
wasm:
# Checking all WASM code with Clippy
cargo metadata --no-deps --format-version=1 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider to use shebang scripts and paste lines directly from ./scripts/src/clippy.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-pleasereview PR is ready to be reviewed by the team D5-tooling Helper tools and utilities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants