name: Cross-Platform Tests
on:
push:
branches: [ "main", "debug/*", "feature/*", "claude/*" ]
paths:
- 'src/**'
- 'tests/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/cross-platform.yml'
pull_request:
branches: [ main ]
paths:
- 'src/**'
- 'tests/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/cross-platform.yml'
# Security: Explicit permissions following principle of least privilege
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
cross-platform-tests:
# Ubuntu excluded - already covered by ci.yml with SQLite/PostgreSQL/Redis
name: Platform Tests (${{ matrix.platform }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
platform: macOS
- os: windows-latest
platform: Windows
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@1.92.0
with:
components: rustfmt, clippy
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-cross-platform-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt --all -- --check
- name: Setup Bun (for SDK build)
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Build MCP SDK (required for E2E tests)
working-directory: sdk
run: |
bun install --frozen-lockfile
bun run build
- name: Clippy check (with cognitive complexity)
shell: bash
run: cargo clippy --all-targets --quiet -- -D warnings -D clippy::all -D clippy::pedantic -D clippy::nursery -W clippy::cognitive_complexity
env:
DATABASE_URL: "sqlite::memory:"
ENCRYPTION_KEY: "rEFe91l6lqLahoyl9OSzum9dKa40VvV5RYj8bHGNTeo="
PIERRE_MASTER_ENCRYPTION_KEY: "rEFe91l6lqLahoyl9OSzum9dKa40VvV5RYj8bHGNTeo="
- name: Run tests
shell: bash
# Note: Using --lib --bins --tests instead of --all-targets to exclude benches
# Criterion benchmarks don't accept --test-threads and will fail
# Debug builds used on all platforms - release builds on Windows/MSVC take 2+ hours
run: cargo test --lib --bins --tests --quiet -- --test-threads=4
env:
DATABASE_URL: "sqlite::memory:"
ENCRYPTION_KEY: "rEFe91l6lqLahoyl9OSzum9dKa40VvV5RYj8bHGNTeo="
PIERRE_MASTER_ENCRYPTION_KEY: "rEFe91l6lqLahoyl9OSzum9dKa40VvV5RYj8bHGNTeo="
STRAVA_CLIENT_ID: "test_client_id_ci"
STRAVA_CLIENT_SECRET: "test_client_secret_ci"
STRAVA_REDIRECT_URI: "http://localhost:8080/auth/strava/callback"
- name: Test health monitoring functions
shell: bash
run: cargo test health --quiet
env:
DATABASE_URL: "sqlite::memory:"
ENCRYPTION_KEY: "rEFe91l6lqLahoyl9OSzum9dKa40VvV5RYj8bHGNTeo="
PIERRE_MASTER_ENCRYPTION_KEY: "rEFe91l6lqLahoyl9OSzum9dKa40VvV5RYj8bHGNTeo="
- name: Platform summary
run: |
echo "✅ Platform: ${{ matrix.platform }}"
echo "✅ Clippy: All platform-specific code passed"
echo "✅ Tests: All platform-specific tests passed"