debtmap 0.22.0

Code complexity and technical debt analyzer
Documentation
name: Debtmap

on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]
  workflow_dispatch:

# Cancel in-progress runs when new commits are pushed
concurrency:
  group: "${{ github.workflow }}-${{ github.ref }}"
  cancel-in-progress: true

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always
  CARGO_INCREMENTAL: 0
  CARGO_PROFILE_DEV_DEBUG: line-tables-only
  RUST_BACKTRACE: 1

jobs:
  validate:
    name: Technical Debt Validation
    runs-on: ubuntu-latest
    timeout-minutes: 60

    steps:
    - name: Checkout repository
      uses: actions/checkout@v7
      with:
        fetch-depth: 0

    - name: Setup Rust
      uses: dtolnay/rust-toolchain@stable
      with:
        components: rustfmt, clippy

    - name: Cache Rust dependencies
      uses: Swatinem/rust-cache@v2
      with:
        cache-bin: "false"

    - name: Build debtmap debug binary
      run: |
        cargo build
        echo "Disk space after debug build:"
        df -h

    - name: Run debtmap validation
      run: ./target/debug/debtmap validate . --format json --output debtmap-report.json --context

    - name: Upload debtmap report
      if: always()
      uses: actions/upload-artifact@v7
      with:
        name: debtmap-analysis-artifacts
        path: debtmap-report.json
        retention-days: 7