-
-
Notifications
You must be signed in to change notification settings - Fork 51
[DX/CI/TEST]: Add cargo-make scripts and formatting tools #318
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
3534455 to
4df0e1a
Compare
|
Not entirely sure what's failing with formatting wise unless it's the fact it's attempting to format using non-nightly toolchain formatter, but I've updated that to reflect and everything still builds fine. |
9e37d0d to
c48848b
Compare
|
Oh - You're wanting to call a check against the current formatting. After review and when deciding to merge I'll format the project and push a single change that will have all the formatting done so it's a single commit on its own, should make it easier to review. |
|
This also closes out #316 with mostly the same changes - however, this opts to use @MordechaiHadad - When time permits; I'd love to see this merged to ease the development flow. Important note regarding CI/CD builds! (GitHub workflows/actions)
& A choice needs to be made on which handles the toolchain when building in CI -
Some existing parts will need to remain part of CI/CD due to specific tools that wouldn't make sense being added to the Small noteMy own version of this |
b66d50f to
79a488c
Compare
|
This |
79a488c to
a9a71b8
Compare
fix: test_is_version test failing due to change fix: test_is_hash function due to change
a9a71b8 to
1540223
Compare
Summary
This PR introduces enhanced tooling and code formatting utilities to improve the development and CI/CD workflow.
The new
Makefile.tomlin the project root leveragescargo-maketo bring Makefile-like functionality to Rust projects with enhanced features and clearer syntax.Additionally, this PR integrates
Taplo, a TOML formatter designed to work alongsidecargo fmtto maintain consistent style and syntax across the project.Changes
Cargo-make Scripts
Makefile.tomlwith predefined tasks for common development operationsFormatting Tools
.rustfmt.tomland.taplo.tomlconfiguration filesBenefits
build,build --release,test, andtest --allcargo-makeand calling the appropriate aliases defined inMakefile.tomlUsage
After installing
cargo-make(via package manager or Cargo),developers can use the various aliases (defined as
task.<name>inMakefile.toml) to execute project-wide commands.Most commands automatically run
cargo fmtand Taplo formatting before execution.This creates a "fail-fast" approach for local development-formatting failures will produce errors before building,
providing quicker developer feedback.
Command Overview
The below commands can also be invoked via
makersinstead ofcargo makeif preferred.Build & Run:
cargo make b- Build debug versioncargo make br- Build release versioncargo make r- Run debug versioncargo make rr- Run release versionNote: These commands run formatting checks before building and tests after completion.
Development Tools:
cargo make c- Run cargo checkcargo make cp- Run cargo clippy (stricter analysis thancheck)cargo make cl- Clean project (removes/targetdirectory)cargo make reset- Clean project, then rebuild with both debug and release configurationsDistribution:
cargo make dist- Create distribution package and compress using the OS's native zip implementationImplementation details can be found in
./build/dist-tasks.tomlTesting
Note
I can see there's also additional files being included (e.g.,
vcruntime140.dllfor Windows) + generation of a .desktop file for Linux.These are currently not included as a part of the
disttask.If you'd like these added, let me know and I can look at adding them in as a part of the build & dist creation task/process (Will effectively just be copying one of the various copy block tasks).
Alternatively - There's the option of embedding them into the binary, and unpacking on first run; which may make CI easier, e.g., handling as a part of Rust or a build.rs.