feat: multi-crate workspace refactoring with CI and platform detection #5
Workflow file for this run
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: Vosk Integration Tests | |
| on: | |
| # Run on PRs that modify STT-related code | |
| pull_request: | |
| paths: | |
| - 'crates/coldvox-stt/**' | |
| - 'crates/coldvox-stt-vosk/**' | |
| - 'crates/app/**' | |
| - 'examples/vosk_*.rs' | |
| - '.github/workflows/vosk-integration.yml' | |
| # Weekly scheduled run | |
| schedule: | |
| - cron: '0 0 * * 0' | |
| # Manual trigger | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| concurrency: | |
| group: vosk-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| vosk-tests: | |
| name: Vosk STT Integration | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.1.7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # v1 | |
| with: | |
| toolchain: stable | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libasound2-dev \ | |
| python3 \ | |
| python3-pip \ | |
| wget \ | |
| unzip | |
| - name: Cache Vosk model | |
| id: cache-vosk-model | |
| uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 | |
| with: | |
| path: models/vosk-model-small-en-us-0.15 | |
| key: vosk-model-small-en-us-0.15 | |
| restore-keys: | | |
| vosk-model-small-en-us- | |
| vosk-model- | |
| - name: Download Vosk model | |
| if: steps.cache-vosk-model.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir -p models | |
| cd models | |
| # Retry logic for robustness | |
| for i in 1 2 3; do | |
| wget https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip && break | |
| echo "Download attempt $i failed, retrying..." | |
| sleep 5 | |
| done | |
| unzip vosk-model-small-en-us-0.15.zip | |
| rm vosk-model-small-en-us-0.15.zip | |
| - name: Install cargo-nextest | |
| run: cargo install cargo-nextest --locked | |
| - name: Build with Vosk | |
| run: | | |
| # Build both crates that use Vosk feature | |
| cargo build --locked -p coldvox-stt-vosk --features vosk | |
| cargo build --locked -p app --features vosk | |
| - name: Run Vosk tests | |
| env: | |
| VOSK_MODEL_PATH: models/vosk-model-small-en-us-0.15 | |
| RUST_TEST_THREADS: 1 # Vosk may have threading issues | |
| run: | | |
| cargo nextest run --locked -p coldvox-stt-vosk --features vosk | |
| - name: Run end-to-end WAV pipeline test | |
| env: | |
| VOSK_MODEL_PATH: models/vosk-model-small-en-us-0.15 | |
| run: | | |
| cargo test --locked -p app --features vosk test_end_to_end_wav_pipeline -- --ignored --nocapture | |
| - name: Test Vosk examples | |
| env: | |
| VOSK_MODEL_PATH: models/vosk-model-small-en-us-0.15 | |
| run: | | |
| # Run Vosk examples if they exist | |
| if ls examples/vosk_*.rs 1> /dev/null 2>&1; then | |
| for example in examples/vosk_*.rs; do | |
| name=$(basename $example .rs) | |
| cargo run --locked --example $name --features vosk,examples || true | |
| done | |
| fi | |
| - name: Upload artifacts on failure | |
| if: failure() | |
| uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
| with: | |
| name: vosk-test-artifacts | |
| path: | | |
| target/debug/**/*.log | |
| logs/ | |
| transcripts/ | |
| retention-days: 7 |