mobux 0.40.2

A touch-friendly tmux web UI for unhinged people who run terminal sessions from their phone while walking the dog
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:
          # sherpa-rs downloads the prebuilt onnxruntime/sherpa-onnx libs
          # here; without caching it, a warm target/ cache makes cargo skip
          # the build-script download and the linker can't find -lonnxruntime.
          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
      # The voice is pinned by content, so its own hash is the cache key: a
      # refreshed checkpoint misses the cache and is fetched, an unchanged one
      # never leaves it.
      - 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
      # Real weights, real synthesis — the one thing the default suite cannot
      # cover, and the only place the realtime margin is measured.
      - 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
      # The model is pinned by content, so its own hash is the cache key: a
      # refreshed model misses the cache and is fetched, an unchanged one never
      # leaves the cache.
      - 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
      # The default job compiles the crate without the feature, so without this
      # every test under src/local_stt/ is built here and never run.
      - run: cargo test --features local-stt
      # Real weights, real inference, on the bundled sample clip — the one
      # thing the default suite cannot cover. The bundled checkpoint only: the
      # download-on-demand ones are covered by the fetch-path tests.
      - 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:
          # sherpa-rs downloads the prebuilt onnxruntime/sherpa-onnx libs
          # here; without caching it, a warm target/ cache makes cargo skip
          # the build-script download and the linker can't find -lonnxruntime.
          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:
          # sherpa-rs downloads the prebuilt onnxruntime/sherpa-onnx libs
          # here; without caching it, a warm target/ cache makes cargo skip
          # the build-script download and the linker can't find -lonnxruntime.
          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