name: Feature Matrix Testing
on:
pull_request:
branches: [main]
push:
branches: [main]
schedule:
- cron: '0 0 */3 * *'
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
CARGO_TOOLCHAIN: stable
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
jobs:
feature-combinations:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
features:
- "auth"
- "docs"
- "communication"
- "hr"
- "ai"
- "meeting"
- "cardkit"
- "security"
- "workflow"
- "application"
- "websocket"
- "otel"
- "platform"
- "analytics"
- "user"
- "docs-base"
- "docs-bitable"
- "communication,auth"
- "docs,auth"
- "communication,docs"
- "communication,websocket"
- "hr,communication"
- "docs,docs-base,docs-bitable"
- "essential"
- ""
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ env.CARGO_TOOLCHAIN }}
- name: Cache Cargo build files
uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: 23.4
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build with feature combination
run: |
echo "Testing feature combination: ${{ matrix.features }}"
if [ -z "${{ matrix.features }}" ]; then
echo "Building with no features (minimal build)"
timeout 15m cargo build --no-default-features
else
echo "Building with features: ${{ matrix.features }}"
timeout 15m cargo build --no-default-features --features "${{ matrix.features }}"
fi
- name: Test with feature combination
run: |
if [ -z "${{ matrix.features }}" ]; then
echo "Testing with no features"
timeout 10m cargo test --no-default-features --lib
else
echo "Testing with features: ${{ matrix.features }}"
timeout 10m cargo test --no-default-features --features "${{ matrix.features }}" --lib
fi
cargo-hack-testing:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ env.CARGO_TOOLCHAIN }}
- name: Install cargo-hack
uses: taiki-e/install-action@v2
with:
tool: cargo-hack
- name: Cache Cargo build files
uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: 23.4
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Test each feature individually
run: |
echo "## Feature Testing Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# Test each feature individually (excluding websocket due to heavy dependencies)
timeout 30m cargo hack test --each-feature --exclude-features websocket --lib \
|| echo "❌ Some individual feature tests failed" >> $GITHUB_STEP_SUMMARY
- name: Test core feature combinations
run: |
echo "### Core Feature Combinations" >> $GITHUB_STEP_SUMMARY
# Test combinations of core features
CORE_FEATURES="auth,docs,communication,hr,ai,websocket"
echo "Testing core features: $CORE_FEATURES" >> $GITHUB_STEP_SUMMARY
if timeout 20m cargo hack test --feature-powerset --depth 2 \
--features "$CORE_FEATURES" --lib; then
echo "✅ Core feature combinations passed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Some core feature combinations failed" >> $GITHUB_STEP_SUMMARY
fi