Files
foxhunt/.github/workflows/test.yml
jgrusewski fa4c649338 fix(ci): triage workflows — fix 3 essential, delete 6 duplicates
Essential workflow fixes:
- ci.yml: add SQLX_OFFLINE=true, replace fictitious cargo subcommands
  (test-unit, ci-lint, audit-deps, etc.) with real cargo commands,
  remove broken 9-way test matrix, remove instrument-coverage RUSTFLAGS
- test.yml: add SQLX_OFFLINE=true to build-check job, fix conflicting
  clippy flags (-D and -W on clippy::all), update JWT secret to 32+ chars
- compilation-guard.yml: add SQLX_OFFLINE=true, remove references to
  non-existent paths (services/trading-engine, crates/common/types),
  remove dangerous auto-commit-to-main, remove MIRI on missing packages

Deleted duplicates (justification):
- comprehensive_testing.yml: duplicate of comprehensive-testing.yml
  (same purpose, underscore vs hyphen naming)
- production-deploy.yml: duplicate of production-deployment.yml
  (both named "Production Deployment Pipeline", this one has stale paths)
- coverage-fixed.yml: duplicate of coverage.yml
  (uses deprecated actions-rs/toolchain@v1 and actions/cache@v3)
- performance.yml: duplicate of benchmark_regression.yml
  (both "Performance Regression Detection", this one less mature)
- quality-baseline.json: not a workflow, stale fake data (999 warnings)
- quality-metrics.json: not a workflow, stale fake data

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:39:00 +01:00

171 lines
4.3 KiB
YAML

name: Test Pipeline
on:
push:
branches:
- main
- develop
- 'feature/**'
pull_request:
branches:
- main
- develop
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
SQLX_OFFLINE: "true"
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: timescale/timescaledb:latest-pg16
env:
POSTGRES_USER: foxhunt
POSTGRES_PASSWORD: foxhunt_dev_password
POSTGRES_DB: foxhunt
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: postgresql://foxhunt:foxhunt_dev_password@localhost:5432/foxhunt
REDIS_URL: redis://localhost:6379
JWT_SECRET: test_jwt_secret_key_minimum_32chars_long
RUST_LOG: info
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Cargo Registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Check Formatting
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --workspace --all-targets
- name: Run Unit Tests
run: cargo test --workspace --lib
env:
RUST_LOG: debug
- name: Run Integration Tests
run: cargo test --workspace --tests -- --test-threads=1
timeout-minutes: 15
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: target/nextest/
retention-days: 30
security-audit:
name: Security Audit
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install Cargo Audit
run: cargo install --locked cargo-audit
- name: Run Security Audit
run: cargo audit
build-check:
name: Build Check
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo Registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check Compilation
run: cargo check --workspace --all-targets
- name: Build Release
run: cargo build --workspace --release
summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [test, security-audit, build-check]
if: always()
steps:
- name: Generate Summary
run: |
echo "## Test Pipeline Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Job | Status |" >> $GITHUB_STEP_SUMMARY
echo "|-----|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Test Suite | ${{ needs.test.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Security Audit | ${{ needs.security-audit.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Build Check | ${{ needs.build-check.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
- name: Check Overall Status
if: contains(needs.*.result, 'failure')
run: |
echo "::error::Pipeline failed - check job results above"
exit 1