Files

66 lines
2.0 KiB
YAML

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
quality:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Tauri Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust
uses: swatinem/rust-cache@v2
with:
workspaces: ./src-tauri -> target
- name: Install frontend dependencies
run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Frontend tests
run: npm run test -- --run
- name: Frontend build
run: npm run build
- name: Rust tests
run: cargo test --manifest-path src-tauri/Cargo.toml
- name: Setup sherpa-onnx sidecar (Linux)
run: SHERPA_ONNX_TRIPLE=x86_64-unknown-linux-gnu node scripts/setup-sidecar.mjs
- name: Setup audio fixtures
run: node scripts/setup-fixtures.mjs
- name: Setup sherpa-onnx model (CI roda teste de transcrição real)
# 670 MB; em CI é lento mas confiável.
env:
SHERPA_MODEL_DIR: src-tauri/models/sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8
run: node scripts/setup-sidecar.mjs && mkdir -p "$SHERPA_MODEL_DIR" && curl -sL "https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8.tar.bz2" | tar -xj -C "$SHERPA_MODEL_DIR" --strip-components=1
- name: Run real transcription test
env:
SHERPA_MODEL_DIR: src-tauri/models/sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8
run: cargo test --manifest-path src-tauri/Cargo.toml -- --ignored sherpa_onnx::tests::real_transcription_returns_known_text