v2.0.1 of bindings #519
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 | |
| SKIP_INTEGRATION_TESTS: yes | |
| jobs: | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: rustup toolchain install stable --profile minimal --component rustfmt | |
| - run: cargo fmt --all -- --check | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libtesseract-dev libleptonica-dev | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ~/.cache/pdfium-rs | |
| target | |
| key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} | |
| - run: rustup toolchain install stable --profile minimal --component clippy | |
| - run: cargo clippy --all-targets | |
| build-and-test: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libtesseract-dev libleptonica-dev | |
| - name: Install system dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install tesseract leptonica | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ~/.cache/pdfium-rs | |
| ~/Library/Caches/pdfium-rs | |
| ${{ runner.os == 'Windows' && format('{0}\pdfium-rs', env.LOCALAPPDATA) || '' }} | |
| target | |
| key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Force Ninja generator (Windows) | |
| if: runner.os == 'Windows' | |
| run: echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV | |
| shell: bash | |
| - run: cargo build --workspace --all-targets --exclude liteparse-python --exclude liteparse-napi | |
| - run: cargo test --workspace --exclude liteparse-python --exclude liteparse-napi | |
| - name: CLI smoke test | |
| if: runner.os != 'Windows' | |
| run: | | |
| ./target/debug/lit --version | |
| ./target/debug/lit parse demo/docs/apple-10k-2024.pdf --no-ocr --max-pages 1 -q | head -5 | |
| # Test that docker builds | |
| build-docker-image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build the base Docker image | |
| run: docker build . | |
| - name: Build the full Docker image | |
| run: docker build . -f full.Dockerfile |