feat: add source-aligned text normalization APIs and CLI #192
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| fmt: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --all --check | |
| test: | |
| name: Test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.os }} | |
| - name: Build | |
| run: cargo build --verbose | |
| - name: Run unit & integration tests | |
| run: cargo test --verbose | |
| - name: Run tests with FFI feature | |
| run: cargo test --features ffi --verbose | |
| - name: Run tests in release mode | |
| run: cargo test --release --verbose | |
| swift-ffi: | |
| name: Swift FFI Tests | |
| runs-on: macos-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-darwin | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: swift-ffi | |
| - name: Build static library for Swift | |
| run: cargo build --release --features "ffi,fst-engine" --target aarch64-apple-darwin | |
| - name: Run Swift FFI smoke test | |
| working-directory: swift-test | |
| run: swift run NemoTest | |
| wasm: | |
| name: WASM | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: wasm | |
| - uses: jetli/wasm-pack-action@v0.4.0 | |
| - run: npm run wasm:ci | |
| fst-engine: | |
| name: FST Engine Parity (7 langs vs NeMo) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: fst-engine | |
| # Runs the bundled NeMo-golden fixtures through the FST engine and asserts | |
| # byte-exact parity for zh, fr, ja, en, hi, es, de. Release mode keeps the | |
| # big-grammar languages (hi, es) fast. | |
| - name: Run FST-engine parity tests | |
| run: cargo test --release --features fst-engine --test fst_parity -- --nocapture |