nsip 0.4.0

NSIP Search API client for nsipsearch.nsip.org/api
Documentation
---
name: Code Quality Metrics

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

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

permissions:
  contents: read

jobs:
  metrics:
    name: Collect Code Quality Metrics
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2

      - name: Setup Rust with caching
        uses: ./.github/actions/setup-rust-cached
        with:
          toolchain: stable
          cache-key: metrics

      - name: Install cargo-geiger
        uses: ./.github/actions/install-cargo-tool
        with:
          tool: cargo-geiger

      - name: Install cargo-bloat
        uses: ./.github/actions/install-cargo-tool
        with:
          tool: cargo-bloat

      - name: Scan for unsafe code
        run: |
          echo "## Unsafe Code Analysis" > metrics-report.md
          echo '```' >> metrics-report.md
          cargo geiger --all-features >> metrics-report.md || true
          echo '```' >> metrics-report.md
          echo "" >> metrics-report.md

      - name: Analyze binary size
        run: |
          cargo build --release
          echo "## Binary Size Analysis" >> metrics-report.md
          echo '```' >> metrics-report.md
          cargo bloat --release --crates >> metrics-report.md
          echo '```' >> metrics-report.md
          echo "" >> metrics-report.md

      - name: Check documentation coverage
        run: |
          echo "## Documentation Coverage" >> metrics-report.md
          echo '```' >> metrics-report.md
          cargo doc --no-deps --all-features 2>&1 | grep -E "Documenting|warning" >> metrics-report.md || true
          echo '```' >> metrics-report.md

      - name: Upload metrics report
        uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f  # v7.0.0
        with:
          name: code-quality-metrics
          path: metrics-report.md
          retention-days: 30