name: Compatibility Matrix
on:
push:
branches: [main]
pull_request:
schedule:
- cron: '0 9 * * 1'
permissions:
contents: read
issues: write
jobs:
rust-versions:
name: Rust ${{ matrix.rust }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
- beta
- nightly
- 1.89.0 steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
- name: Build
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"
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 }}
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-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"
- "auth,auth-jwt"
- "auth,auth-axum"
- "auth,auth-tonic,router-grpc"
- "resilience"
- "resilience,cache-memory"
- "security"
- "health"
- "http-client"
- "metrics"
- "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-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
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"
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
- name: Run ${{ matrix.ecosystem.name }} compatibility tests
run: echo "Compatibility test for ${{ matrix.ecosystem.name }}"
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']
})