pdfium 0.10.3

Modern Rust interface to PDFium, the PDF library from Google
Documentation
name: Run cargo unittests

on:
  push:
  pull_request:

jobs:
  build:
    name: Tests

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-24.04, windows-2025, macos-15]

    runs-on: ${{ matrix.os }}

    permissions:
      contents: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Get PDFium for Ubuntu
        if: runner.os == 'Linux'
        shell: bash
        run: |
          wget https://github.com/bblanchon/pdfium-binaries/releases/latest/download/pdfium-linux-x64.tgz
          tar xf pdfium-linux-x64.tgz --strip-components=1 lib/libpdfium.so
          rm -f pdfium-linux-x64.tgz
          file libpdfium.so

      - name: Get PDFium for Windows
        if: runner.os == 'Windows'
        shell: bash
        run: |
          curl -L https://github.com/bblanchon/pdfium-binaries/releases/latest/download/pdfium-win-x64.tgz --output pdfium-win-x64.tgz
          tar xf pdfium-win-x64.tgz --strip-components=1 bin/pdfium.dll
          rm -f pdfium-win-x64.tgz
          file pdfium.dll

      - name: Get PDFium for Macos
        if: runner.os == 'Macos'
        shell: bash
        run: |
          wget https://github.com/bblanchon/pdfium-binaries/releases/latest/download/pdfium-mac-arm64.tgz
          tar xf pdfium-mac-arm64.tgz --strip-components=1 lib/libpdfium.dylib
          rm -f pdfium-mac-arm64.tgz
          file libpdfium.dylib

      - name: Test pdfium-rs
        run: |
          cargo test

      - name: Test build on Rust 1.87
        if: runner.os == 'Linux'
        run: |
          docker build -t pdfium-rs-test .

      - name: Upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: pdfium-rs-output-${{ matrix.os }}
          path: |
            *.png
            *.jpg
            *.pdf
            *.txt