allframe 0.1.28

Complete Rust web framework with built-in HTTP/2 server, REST/GraphQL/gRPC, compile-time DI, CQRS - TDD from day zero
Documentation
name: Compatibility Matrix

# Test against multiple versions of key dependencies
# This ensures AllFrame works with a range of versions

on:
  push:
    branches: [main]
  pull_request:
  schedule:
    # Run weekly to catch breaking changes early
    - cron: '0 9 * * 1'  # Monday 9 AM UTC

permissions:
  contents: read
  issues: write

jobs:
  # Test against different Rust versions
  rust-versions:
    name: Rust ${{ matrix.rust }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        rust:
          - stable
          - beta
          - nightly
          - 1.89.0  # MSRV (Minimum Supported Rust Version - required for async-graphql 7.2.1)
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
      - uses: Swatinem/rust-cache@v2

      - name: Build
        # Exclude cqrs-allsource due to upstream compilation errors in allsource-core
        # See: docs/current/ALLSOURCE_CORE_ISSUES.md
        # Include all stable features: router, cqrs, auth, resilience, cache
        run: cargo build -p allframe-core --features="di,openapi,router,router-graphql,router-grpc,router-full,cqrs,otel,health,auth,auth-jwt,auth-axum,auth-tonic,security,resilience,cache-memory,http-client,metrics"

      - name: Test
        run: cargo test -p allframe-core --lib --features="di,openapi,router,router-graphql,router-grpc,router-full,cqrs,otel,health,auth,auth-jwt,auth-axum,auth-tonic,security,resilience,cache-memory,http-client,metrics"

  # Test against different dependency versions
  dependency-versions:
    name: Dependencies - ${{ matrix.profile.name }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        profile:
          - name: "latest"
            description: "Latest versions of all dependencies"
            toolchain: "stable"
            flags: ""

          - name: "minimal"
            description: "Minimum supported versions"
            toolchain: "nightly"
            flags: "-Z minimal-versions"

          - name: "async-graphql-v7"
            description: "Pinned async-graphql v7"
            toolchain: "stable"
            update: "async-graphql"
            flags: ""

          - name: "tonic-v0.13"
            description: "Pinned tonic v0.13"
            toolchain: "stable"
            update: "tonic@0.13 prost@0.13"
            flags: ""

    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.profile.toolchain }}
      - uses: Swatinem/rust-cache@v2

      - name: Update specific dependencies
        if: matrix.profile.update
        run: |
          for dep in ${{ matrix.profile.update }}; do
            cargo update -p $dep
          done

      - name: Fix minimal versions for tonic compatibility
        if: matrix.profile.name == 'minimal'
        run: |
          # tonic 0.14.0 requires http 1.0+ with try_insert method
          # Ensure http is at least 1.1.0 (introduced try_insert)
          cargo update -p http --precise 1.1.0

      - name: Build with ${{ matrix.profile.name }}
        # Exclude cqrs-allsource due to upstream compilation errors
        run: cargo build -p allframe-core --features="di,openapi,router,router-graphql,router-grpc,router-full,cqrs,otel,health,auth,auth-jwt,auth-axum,auth-tonic,security,resilience,cache-memory,http-client,metrics" ${{ matrix.profile.flags }}

      - name: Test with ${{ matrix.profile.name }}
        run: cargo test -p allframe-core --lib --features="di,openapi,router,router-graphql,router-grpc,router-full,cqrs,otel,health,auth,auth-jwt,auth-axum,auth-tonic,security,resilience,cache-memory,http-client,metrics"

  # Feature flag combinations
  feature-matrix:
    name: Features - ${{ matrix.features }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        features:
          - "default"
          - "router"
          - "router-graphql"
          - "router-grpc"
          - "router-full"
          - "di,openapi"
          - "di,openapi,router-full"
          # Auth features
          - "auth"
          - "auth,auth-jwt"
          - "auth,auth-axum"
          - "auth,auth-tonic,router-grpc"
          # Resilience features
          - "resilience"
          - "resilience,cache-memory"
          # Additional features
          - "security"
          - "health"
          - "http-client"
          - "metrics"
          # Offline-first profiles (Issue #36)
          - "cqrs,di"
          - "cqrs,di,resilience,security"
          - "router,cqrs,di"
          - "cqrs,di,auth,auth-jwt,security"
          - "cqrs,di,cache-memory"

    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2

      - name: Build with features=${{ matrix.features }}
        run: cargo build -p allframe-core --features=${{ matrix.features }}

      - name: Test with features=${{ matrix.features }}
        run: cargo test -p allframe-core --lib --features=${{ matrix.features }}

  # Platform compatibility
  platform-matrix:
    name: Platform - ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          - macos-latest
          - windows-latest

    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2

      - name: Build
        # Exclude cqrs-allsource due to upstream compilation errors in allsource-core
        # See: docs/current/ALLSOURCE_CORE_ISSUES.md
        run: cargo build -p allframe-core --features="di,openapi,router,router-graphql,router-grpc,router-full,cqrs,otel,health,auth,auth-jwt,auth-axum,auth-tonic,security,resilience,cache-memory,http-client,metrics"

      - name: Test
        run: cargo test -p allframe-core --lib --features="di,openapi,router,router-graphql,router-grpc,router-full,cqrs,otel,health,auth,auth-jwt,auth-axum,auth-tonic,security,resilience,cache-memory,http-client,metrics"

  # External ecosystem compatibility
  ecosystem-compat:
    name: Ecosystem - ${{ matrix.ecosystem }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        ecosystem:
          - name: "axum"
            description: "Compatibility with Axum"
          - name: "actix"
            description: "Compatibility with Actix"
          - name: "juniper"
            description: "GraphQL interop with Juniper"

    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2

      # Future: Add ecosystem compatibility tests
      - name: Run ${{ matrix.ecosystem.name }} compatibility tests
        run: echo "Compatibility test for ${{ matrix.ecosystem.name }}"

  # Notify on failures
  notify:
    name: Notify on failure
    runs-on: ubuntu-latest
    needs: [rust-versions, dependency-versions, feature-matrix, platform-matrix]
    if: failure()
    steps:
      - name: Create issue on failure
        uses: actions/github-script@v7
        with:
          script: |
            github.rest.issues.create({
              owner: context.repo.owner,
              repo: context.repo.repo,
              title: 'Compatibility Matrix Failed',
              body: 'The compatibility matrix CI has failed. Please investigate.\n\nRun: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
              labels: ['ci', 'compatibility', 'needs-investigation']
            })