Nightly Multi-Platform Testing #99
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: Nightly Multi-Platform Testing | |
| on: | |
| schedule: | |
| - cron: '0 2 * * *' # Daily at 2 AM UTC | |
| workflow_dispatch: # Allow manual triggering | |
| # Add explicit permissions | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| # Multi-platform testing with nightly and beta Rust | |
| test-multi-platform: | |
| name: Multi-Platform Tests (${{ matrix.os }}, ${{ matrix.rust }}) | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| rust: nightly | |
| - os: ubuntu-latest | |
| rust: beta | |
| - os: windows-latest | |
| rust: nightly | |
| - os: macos-latest | |
| rust: nightly | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: nightly-${{ matrix.rust }}-${{ matrix.os }}-${{ hashFiles('**/Cargo.lock') }} | |
| cache-on-failure: true | |
| cache-all-crates: true | |
| shared-key: ${{ matrix.os }}-${{ hashFiles('**/Cargo.lock') }} | |
| cache-targets: true | |
| - name: Install dependencies (Ubuntu) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pkg-config libssl-dev | |
| - name: Install dependencies (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew install pkg-config openssl | |
| - name: Install dependencies (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| # Windows dependencies are typically handled by rust-cache | |
| echo "Windows dependencies handled by rust-cache" | |
| # Run all tests and builds in parallel | |
| - name: Run tests and builds | |
| run: | | |
| # Start all jobs in background | |
| cargo test --all-targets --all-features & | |
| cargo build --all-targets --all-features & | |
| cargo build --examples --all-features & | |
| # Wait for all background jobs | |
| wait | |
| # Test with minimal features | |
| - name: Test minimal features | |
| run: | | |
| cargo test --no-default-features --lib | |
| cargo test --features http --lib | |
| cargo test --features oauth --lib | |
| # Run benchmarks (only on Linux nightly) | |
| - name: Run benchmarks | |
| if: matrix.os == 'ubuntu-latest' && matrix.rust == 'nightly' | |
| run: cargo bench --all-features --no-run | |
| # Upload benchmark results (only on Linux nightly) | |
| - name: Upload benchmark results | |
| if: matrix.os == 'ubuntu-latest' && matrix.rust == 'nightly' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-results-${{ matrix.rust }} | |
| path: target/criterion/ | |
| # Integration tests (only on Linux nightly) | |
| integration-tests: | |
| name: Integration Tests (Linux, Nightly) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| needs: test-multi-platform | |
| if: always() && needs.test-multi-platform.result == 'success' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: integration-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} | |
| cache-on-failure: true | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pkg-config libssl-dev | |
| - name: Run integration tests | |
| run: | | |
| cargo test --test integration_tests --all-features | |
| cargo test --test http_integration_tests --all-features | |
| cargo test --test test_ergonomic_api --all-features | |
| # Performance benchmarks (only on Linux nightly) | |
| performance: | |
| name: Performance Benchmarks (Linux, Nightly) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| needs: test-multi-platform | |
| if: always() && needs.test-multi-platform.result == 'success' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: performance-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} | |
| cache-on-failure: true | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pkg-config libssl-dev | |
| - name: Run performance benchmarks | |
| run: | | |
| cargo bench --all-features | |
| - name: Upload performance results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: performance-results | |
| path: target/criterion/ |