Skip to content

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Dec 16, 2025

Summary

Migrates all build scripts and CI tasks to cargo-make for better maintainability and DRY compliance.

Changes

  • Added Makefile.toml - Comprehensive cargo-make configuration with 60+ tasks covering:

    • Development (fmt, clippy, lint, doc)
    • Security (cargo-deny checks)
    • Testing (Rust, Python, Node.js)
    • Coverage (all platforms)
    • Utilities (benchmarks, version checking)
    • CI composite tasks
  • Simplified CI workflow - Replaced inline commands with cargo-make tasks in .github/workflows/ci.yml (-131 lines)

  • Added check-versions task - New utility for checking outdated dependencies

  • Removed redundant scripts - Deleted benchmarks/compare.sh (functionality now in bench-compare task)

  • Updated README - Added comprehensive cargo-make usage documentation

Benefits

  • DRY Principle - Single source of truth for all tasks
  • Local = CI Parity - Developers run exact same commands as CI
  • Cross-Platform - Works on Linux, macOS, Windows
  • Self-Documenting - cargo make --list-all-steps shows all tasks
  • Automatic Tooling - cargo-make installs required tools automatically

Quick Reference

cargo make fmt              # Format code
cargo make clippy           # Lint
cargo make test-rust        # Run tests
cargo make check-versions   # Check dependencies
cargo make bench-compare    # Compare performance
cargo make ci-all           # Run all CI checks locally

Resolves #10

Implement unified task management using cargo-make for both local
development and CI/CD workflows. This provides a single source of truth
for all build, test, and deployment tasks.

Changes:
- Add Makefile.toml with comprehensive task definitions
- Migrate CI workflows to use cargo-make tasks
- Add check-versions utility task for dependency management
- Remove redundant benchmarks/compare.sh script
- Update README with cargo-make usage documentation

Tasks implemented:
- Development: fmt, clippy, lint, doc-check
- Security: deny-advisories, deny-licenses, deny-bans
- Testing: test-rust, test-python, test-node, doctests
- Coverage: coverage-rust, coverage-python, coverage-node
- Utilities: check-versions, bench, bench-compare
- CI composite: ci-lint, ci-security, ci-test-*, ci-coverage-*
- MSRV: msrv-check

Benefits:
- DRY principle - single source of truth
- Local development matches CI environment
- Cross-platform task compatibility
- Easy maintenance and updates
- Self-documenting via cargo make --list-all-steps

Resolves #10
Node.js native test runner outputs coverage to console only.
Use npm run test:coverage which invokes c8 to generate lcov reports.
cargo-make does not allow both command and script in the same task.
Keep only the script block which pipes output through clippy-sarif.
CodeQL is already enabled for security scanning.
Remove redundant clippy-sarif integration to simplify CI.
@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #13   +/-   ##
=======================================
  Coverage   78.80%   78.80%           
=======================================
  Files          27       27           
  Lines        4303     4303           
=======================================
  Hits         3391     3391           
  Misses        912      912           
Flag Coverage Δ
rust-core 78.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Use taiki-e/install-action@cargo-deny instead of cargo-make install
- Replace bash scripts with cross-platform cargo-make commands
- Split test-node, test-python, coverage-* tasks into subtasks
- Use cwd and command/args instead of script blocks
- Fixes Windows CI failures due to missing /bin/bash
- Use script_runner = "@shell" for Node.js tasks to fix Windows npm.cmd resolution
- Install cargo-llvm-cov and cargo-nextest via taiki-e/install-action (faster)
- Add shell: bash to CI step for consistent behavior
- Replace npm with pnpm (~2-3x faster installs)
- Convert package-lock.json to pnpm-lock.yaml
- Update CI to use pnpm/action-setup
- Update Makefile.toml tasks to use pnpm commands
Native binaries are not published to npm yet. Remove optionalDependencies
to fix pnpm --frozen-lockfile check. They will be added back when publishing.
@bug-ops bug-ops merged commit ee8f69f into main Dec 16, 2025
28 checks passed
@bug-ops bug-ops deleted the feature/cargo-make-migration branch December 16, 2025 01:03
bug-ops added a commit that referenced this pull request Dec 16, 2025
Fixes code scanning alert #13: checkout of untrusted code in trusted context.
The labeler action doesn't need to checkout code - it reads changed files via API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate all scripts and CI tasks to cargo-make

3 participants