add mmermaid and graphviz support #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - develop | |
| - main | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| check: | |
| name: Check, Test & Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo index | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo build | |
| uses: actions/cache@v4 | |
| with: | |
| path: target | |
| key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cargo fmt | |
| run: cargo fmt --check | |
| - name: Cargo build | |
| run: cargo build --release | |
| - name: Cargo test | |
| run: cargo test | |
| - name: Cargo clippy | |
| run: cargo clippy --all-targets -- -D warnings | |
| publish-check: | |
| name: Publish Check (dry-run) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo index | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cargo publish dry-run | |
| run: cargo publish --dry-run | |
| # Validaciones adicionales para PRs a main | |
| main-pr-checks: | |
| name: Main PR Requirements | |
| if: github.base_ref == 'main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check version bump | |
| run: | | |
| # Obtener la versión actual | |
| CURRENT_VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/') | |
| echo "Versión en Cargo.toml: $CURRENT_VERSION" | |
| # Obtener el último tag | |
| LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | |
| if [ -z "$LAST_TAG" ]; then | |
| echo "✅ Primer release (no hay tags previos)" | |
| else | |
| LAST_VERSION=${LAST_TAG#v} | |
| echo "Última versión en tag: $LAST_VERSION" | |
| if [ "$CURRENT_VERSION" = "$LAST_VERSION" ]; then | |
| echo "❌ Error: La versión en Cargo.toml debe bumpearse en PR a main" | |
| echo "Cambio requerido para PRs a main:" | |
| echo "- develop → main: version DEBE incrementarse" | |
| exit 1 | |
| fi | |
| echo "✅ Versión bumpeada correctamente" | |
| fi |