-
Notifications
You must be signed in to change notification settings - Fork 110
chore: begin replacement of Make and ./scripts/gear.sh
with Just
#4862
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
base: master
Are you sure you want to change the base?
Conversation
Changed Files
|
|
||
- name: "Check clippy" | ||
run: ./scripts/gear.sh clippy gear --all-targets --all-features --locked | ||
run: just clippy native |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)')] |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require()
may simplify script
# Format code via `rustfmt` | ||
[group('actions')] | ||
fmt: | ||
cargo fmt --all | ||
|
||
# Check formatting with `rustfmt` | ||
[group('checks')] | ||
fmt-check: | ||
cargo fmt --all --check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 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: |
There was a problem hiding this comment.
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
[group('checks')] | ||
test-doc: | ||
# Running documentation tests | ||
__GEAR_WASM_BUILDER_NO_BUILD=1 \ | ||
SKIP_WASM_BUILD=1 \ | ||
cargo test --doc --workspace --no-fail-fast |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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 |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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}} |
[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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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 \ |
There was a problem hiding this comment.
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
justfile
as an alternative to existingMakefile
and./scripts/gear.sh
../scripts/gear.sh
with usage of Just in some parts of CI../scrpts/gear.sh
in CI where there's no need for abstraction into a script.