git-editor 2.0.1

A command-line tool to edit git commit timestamps, messages, and author information
Documentation
name: Rust CI/CD Pipeline

on:
  push:
    branches: '**' 
  pull_request:
    branches: '**' 

env:
  CARGO_TERM_COLOR: always

jobs:
  check:
    name: Lint, Format & Test
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: ๐Ÿฆ€ Set up Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true
          components: clippy, rustfmt

      - name: Install dependencies
        run: sudo apt-get update && sudo apt-get install -y pkg-config libssl-dev

      - name: Cache Cargo
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
  
      - name: ๐Ÿ“ฆ Install dependencies
        run: cargo fetch

      - name: ๐Ÿ” Type check
        run: cargo check --all --all-targets

      - name: ๐Ÿงน Run formatter (cargo fmt)
        run: cargo fmt --all --check

      - name: ๐Ÿ”Ž Run Clippy (Linter)
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: ๐Ÿงช Run unit tests
        run: cargo test --lib --verbose

      - name: ๐Ÿ”ง Run integration tests
        run: cargo test --test integration_tests --verbose

      - name: ๐Ÿš€ Run all tests
        run: cargo test --verbose

  cross-build:
    name: Cross Compile Binaries
    needs: check
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4

      - name: ๐Ÿฆ€ Set up Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true
          components: clippy, rustfmt

      - name: Install cross (only for Linux)
        if: matrix.os == 'ubuntu-latest'
        run: cargo install cross --locked

      - name: Build (Native)
        run: cargo build --release

      - name: Save artifact
        uses: actions/upload-artifact@v4
        with:
          name: binary-${{ matrix.os }}
          path: |
            target/release/git-editor
            target/release/git-editor.exe