Skip to content

Building Testing and CI CD

Andrew Paolucci edited this page Nov 19, 2026 · 4 revisions

Building, Testing & CI/CD


Prerequisites

  • Rust Toolchain: 1.88+ supporting Rust 2024 Edition (rustfmt + clippy components installed).
  • Windows: Builds cleanly on both x86_64-pc-windows-msvc and x86_64-pc-windows-gnu (ensure windres or x86_64-w64-mingw32-windres is on PATH for GNU resource compilation in robocopy2rust-win32).
  • Linux (ubuntu-latest CI baseline): Install system font/GUI development headers required by iced (wgpu/winit/fontconfig) and rfd (gtk3):
    sudo apt-get update && sudo apt-get install -y \
      libssl-dev libfontconfig1-dev libgtk-3-dev \
      libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev \
      libgl1-mesa-dev libglu1-mesa-dev libwayland-dev \
      libxkbcommon-dev libxkbcommon-x11-dev \
      libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
  • macOS (aarch64-apple-darwin & x86_64-apple-darwin): Xcode Command Line Tools (cargo build --workspace --release links AppKit/Metal automatically).

Local Build & Verification Commands

git clone https://github.com/adpaolucci/robocopy2rust.git
cd robocopy2rust

# 1. Check all crates and targets
cargo check --workspace --all-targets

# 2. Enforce formatting
cargo fmt --all -- --check

# 3. Strict linting (warnings fail build)
cargo clippy --workspace --all-targets -- -D warnings

# 4. Run full unit + Windows real-robocopy integration test suite
cargo test --workspace

# 5. Build optimized release binaries
cargo build --workspace --release

Compiler & Linker Configuration

  • Release Profile (Cargo.toml): opt-level = 3, lto = "thin", codegen-units = 1, panic = "abort", strip = true.
  • Dev Profile Optimization: clap, clap_builder, and clap_derive compile at opt-level = 2 even in debug builds for snappy CLI responsiveness.
  • Windows Stack Size (.cargo/config.toml): Sets a 16 MiB stack (16777216 bytes) for both msvc and gnu Windows targets.

Automated Test Coverage (24 Workspace Tests)

All 24 tests pass cleanly (cargo test --workspace) across the 7 crates:

Crate Count Verified Behaviors
robocopy2rust-core 11 Path normalization (preserving C:\ & UNC roots), CommandLineToArgvW backslash-doubling quoting, ordered /MIR + /XF + /XD formatting, complex CLI round-trip parsing, UTF-8 & UTF-16LE .rcj round-trip, [KMGTP] size token parsing, lowercase hex encoding (encode_hex_lower), all 0..=16 exit codes, all 8 presets passing validation cleanly, /MT incompatibility & nested-path validation detection, atomic ProfileStore CRUD
robocopy2rust-mcp 3 JSON-RPC initialize (2024-11-05) & tools/list returning 9 tools, robocopy2rust_run blocking destructive /MIR without confirm_destructive=true, mcp_dry_run_executes_real_robocopy_safely (Windows live robocopy.exe /L check confirming files are not copied)
robocopy2rust-cli 3 Cli::try_parse_from parsing across gui --iced & build, assemble_job preset loading + CLI override precedence, destructive run --mirror refusal when --yes is omitted
robocopy2rust-runner 2 Real Robocopy log-line & suffixed byte summary parsing, executes_real_robocopy_copy_sync_dryrun_and_mirror (real Windows robocopy.exe executing /L dry-run → copy exit 1 → synced exit 0 → extra exit 2 → /MIR purge)
robocopy2rust-report 1 Legacy log parsing (/L dry-run detection, summary counts) & full offline html/json/md bundle emission verified free of remote CDNs or external <script src=>
robocopy2rust-win32 2 CLI launch argument + positional .rcj parsing, Win32State preset application preserving Source/Destination paths (plus embedded app.ico icon & PerMonitorV2 manifest)
robocopy2rust-iced 2 Preset path preservation & destructive modal guard activation, raw command import + batch queue add/duplicate/remove actions (plus embedded icon_32x32.rgba window icon)

(Windows-only real robocopy.exe tests in runner and mcp are gated with #[cfg(windows)] so Linux and macOS CI runs cleanly.)


GitHub Actions CI, CodeQL, cargo-deny & Release Automation

Continuous Integration (.github/workflows/ci.yml)

Triggered on every push and pull_request to main across ubuntu-latest, windows-latest, and macos-latest (alongside automated GitHub CodeQL security scanning on main):

  1. cargo check --workspace --all-targets
  2. cargo fmt --all -- --check
  3. cargo clippy --workspace --all-targets -- -D warnings
  4. cargo test --workspace --verbose
  5. cargo build --workspace --release
  6. deny job (EmbarkStudios/cargo-deny-action@v2): Enforces deny.toml (check advisories licenses sources) on every push and PR.

Multi-Platform Release Pipeline & Distribution (packaging/)

  • Workflow (.github/workflows/release.yml): Triggered on v* tags or manual workflow_dispatch; packages x86_64-pc-windows-msvc (.zip), x86_64-unknown-linux-gnu (.tar.gz), aarch64-apple-darwin (.tar.gz), and x86_64-apple-darwin (.tar.gz), each bundling binaries, README.md, LICENSE, NOTICE, and CHANGELOG.md alongside per-archive .sha256 and consolidated SHA256SUMS.txt via softprops/action-gh-release@v3.
  • Published Release: v0.1.0 is live with verified checksums and ready-to-submit WinGet & Homebrew manifests under packaging/.

Contributing Invariants (CONTRIBUTING.md)

  1. Safety First: Preserve Dry-Run (/L) workflows and explicit confirmation gates around /MIR, /PURGE, /MOVE, and /MOV across Win32 GUI, Iced GUI, CLI, and MCP.
  2. 100% Pure Rust UI/Engine: Keep all GUI rendering, parsing, validation, and report generation pure Rust (only wrapping robocopy.exe for transfer execution).
  3. Quoting Integrity: Never allow trailing backslashes to escape closing double quotes (C:\ → "C:\\", non-root C:\foo\ → "C:\foo").
  4. Clean stdout/stdio: Route tracing diagnostics solely to stderr.

Clone this wiki locally