name: SDD Layer

on:
  pull_request:
  push:
    branches:
      - main

jobs:
  validate:
    runs-on: ubuntu-latest
    env:
      SDD_RELEASE_ORCHESTRATION: melhorias-modularizar-src-main-rs-por-dominio-commands-clients-commands-workflow-co-3557c07ccfa4
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy,rustfmt
      - uses: actions/setup-node@v5
        with:
          node-version: 22
          cache: npm
          cache-dependency-path: |
            bot/package-lock.json
            docs-site/package-lock.json
      - name: Install bot dependencies
        working-directory: bot
        run: npm ci
      - name: Install docs dependencies
        working-directory: docs-site
        run: npm ci
      - name: Run SDD validation
        run: |
          cargo build --release
          target/release/sdd mcp config --targets all --force
          target/release/sdd ci --strict-release --name "$SDD_RELEASE_ORCHESTRATION"
