Expose hybrid OCR in the Python API + fix RapidOCR runner crash #111
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] | |
| jobs: | |
| rust: | |
| name: Rust — build & test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-14, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Poppler (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y poppler-utils | |
| - name: Install Poppler (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install poppler | |
| - name: Install Poppler (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: choco install poppler -y | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo build | |
| - run: cargo test | |
| - run: cargo clippy -- -D warnings | |
| - run: cargo fmt --all --check | |
| python: | |
| name: Python SDK — build & test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: { python-version: '3.12' } | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: pip install maturin pytest | |
| - run: | | |
| cd sdks/python | |
| maturin build --release --out dist/ | |
| pip install dist/*.whl | |
| pytest tests/ -v | |
| node: | |
| name: Node.js SDK — build & test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: { node-version: '20' } | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: | | |
| cd sdks/node | |
| npm ci | |
| # Build the Rust native addon | |
| cargo build --manifest-path ../../crates/edgeparse-node/Cargo.toml --release | |
| # Install the platform binary into the local package directory | |
| cp ../../target/release/libedgeparse_node.so npm/linux-x64-gnu/edgeparse-node.linux-x64-gnu.node | |
| # Install the local platform package so require('edgeparse-linux-x64-gnu') resolves | |
| npm install --no-save file:./npm/linux-x64-gnu | |
| npm run build:ts | |
| npm test | |
| wasm: | |
| name: WASM SDK — build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo check -p edgeparse-wasm --target wasm32-unknown-unknown | |
| docker: | |
| name: Docker — smoke build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: docker build -f docker/Dockerfile . | |
| security: | |
| name: Security audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo install cargo-audit cargo-deny --locked | |
| - run: cargo audit --ignore RUSTSEC-2025-0020 | |
| - run: cargo deny check |