kimun 0.34.2

Code metrics tool — health score, complexity, duplication, hotspots, ownership
name: Kimun CI (Kume)

on:
  push:
    branches: [main]
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: Tests & Quality Gates
    runs-on: ubuntu-latest
    steps:
      - name: Tripan
        run: |
          echo '                   ##*****#**#++++*##%                  '
          echo '              ##*+*+------*++*------+***##              '
          echo '           #**=----=+=----*++*----=+=----=+*%           '
          echo '         #*+---------=+=--*++*--=+=---------+*#         '
          echo '       #*=-------------=+-*++*=+=-------------+*#       '
          echo '      #+-----------------=#++#=-----------------+#      '
          echo '    #*----------==--------*++*--------=+----------*#    '
          echo '   #*---------*#----------*++*-----=---++----------*#   '
          echo '  #*---------##+----------*++*----+=+###*-==--------*#  '
          echo ' ##----------##*=----=----*++*------+####++----------#% '
          echo ' #=+=--------+####+*#=----*++*-----=*-=*=+---------=+=# '
          echo '#*--=+=-------=+++==------*++*------=---==-------=+=--*#'
          echo '#-----=+=-----------------*++*-----------------=+=-----#'
          echo '#-------=+=---------------*++*---------------=+=-------#'
          echo '#*************************####*************************#'
          echo '#*************************####*************************#'
          echo '*-------=+=---------------*++*----------------++-------*'
          echo '#-----=+=-----------------*++*------------------++-----#'
          echo '#+--=+=-------==---+------*++*---------=---------=++--+%'
          echo ' #=+=--------==**=-#------*++*--------+#=----------=++# '
          echo ' %#---------=*+####=------*++*-----+######*=---------## '
          echo '  #*--------+--####=+=----*++*-------####+----------*#  '
          echo '   #+----------*=--=------*++*------+*+=**---------*#   '
          echo '    %*----------+---------*++*--------------------*#    '
          echo '      *=-----------------+#++#=-----------------=*      '
          echo '       #*--------------+*=*++*=+=-------------=*#       '
          echo '         *+=---------+*=--*++*--=+=---------++*         '
          echo '           #*+=----=+=----*++*----=+=----=**            '
          echo '              #*++*+------*++*------+*+++               '
          echo '                  ***#****#**#+++***+                   '

      - uses: actions/checkout@v6
        with:
          fetch-depth: 0

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

      - name: Cache cargo registry
        uses: actions/cache@v5
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: ${{ runner.os }}-cargo-

      - name: Format check
        run: cargo fmt --check

      - name: Clippy
        run: cargo clippy -- -D warnings

      - name: Tests
        run: cargo test

      - name: Build km (release)
        if: github.event_name == 'pull_request'
        run: cargo build --release --bin km

      - name: Score gate (changed files and duplicated lines vs main)
        if: github.event_name == 'pull_request'
        run: ./target/release/km score --trend origin/main --fail-if-worse --gate-scope changed