name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-directories: ~/.cache/sherpa-rs
- run: cargo check
- run: cargo test
- run: cargo clippy -- -D warnings
local-tts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
key: local-tts
- uses: actions/setup-node@v4
with:
node-version: 22
- id: voice
run: |
echo "sha=$(node -e 'process.stdout.write(require("./src/local_tts/voice.lock.json").files["voice.onnx"].sha256)')" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
with:
path: .tmp/tts-voice
key: tts-voice-${{ steps.voice.outputs.sha }}
- name: Fetch the voice on a cache miss
run: node scripts/tts-voice.mjs ensure .tmp/tts-voice
- run: cargo clippy --features local-tts --all-targets -- -D warnings
- run: cargo build --release --features local-tts
- name: Speak a normalized block
run: cargo test --release --features local-tts -- --ignored speaks_a_normalized_block
env:
MOBUX_TTS_MODEL_TEST: "1"
MOBUX_TTS_MODEL_DIR: ${{ github.workspace }}/.tmp/tts-voice
local-stt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
key: local-stt
- uses: actions/setup-node@v4
with:
node-version: 22
- id: model
run: |
node -e 'const l=require("./src/local_stt/model.lock.json");const m=l.models.find(m=>m.id===l.vendored);console.log("id="+m.id);console.log("sha="+m.files["model.safetensors"].sha256)' >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
with:
path: .tmp/stt-model
key: stt-model-${{ steps.model.outputs.sha }}
- name: Fetch the speech model on a cache miss
run: node scripts/stt-model.mjs ensure .tmp/stt-model ${{ steps.model.outputs.id }}
- run: cargo clippy --features local-stt --all-targets -- -D warnings
- run: cargo build --release --features local-stt
- run: cargo test --features local-stt
- name: Transcribe the bundled sample
run: cargo test --release --features local-stt -- --ignored transcribes_the_bundled_sample
env:
MOBUX_STT_MODEL_TEST: "1"
MOBUX_STT_MODEL_DIR: ${{ github.workspace }}/.tmp/stt-model
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-directories: ~/.cache/sherpa-rs
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npx playwright install chromium
- run: sudo apt-get install -y tmux
- name: Build mobux
run: cargo build
- name: Run critical-path tests
run: make test-critical-path
env:
CI: true
MOBUX_URL: http://localhost:8281
- name: Run smoke tests
run: make test-smoke
env:
CI: true
MOBUX_URL: http://localhost:8281
- name: Run SPA (/app) tests
run: make test-spa
env:
CI: true
MOBUX_URL: http://localhost:8281
- name: Run renderer conformance tests
run: make test-conformance
env:
CI: true
MOBUX_URL: http://localhost:8281
- name: Run STT settings UX tests
run: make test-stt-ux
env:
CI: true
- name: Run STT per-kind persistence tests
run: make test-stt-per-kind
env:
CI: true
fleet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-directories: ~/.cache/sherpa-rs
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npx playwright install chromium
- run: sudo apt-get install -y tmux
- name: Run fleet tests
run: make test-fleet
env:
CI: true