Skip to content

Test Sourcebuild

Test Sourcebuild #45

# SPDX-FileCopyrightText: 2024 geisserml <geisserml@gmail.com>
# SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
name: Test Sourcebuild
on:
workflow_dispatch:
workflow_call:
defaults:
run:
shell: bash
jobs:
test_sourcebuild:
strategy:
fail-fast: false
matrix:
# NOTE On GH actions, macOS <=13 is Intel, whereas macOS >=14 will be ARM64
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
use_syslibs: [false]
include:
- os: ubuntu-latest
use_syslibs: [true]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Check out pypdfium2 repository
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
fetch-depth: 0 # quick fix for `git describe`
- name: Install deps
run: python3 -m pip install -U -r req/setup.txt -r req/test.txt
- name: Build PDFium (default)
if: ${{ !matrix.use_syslibs }}
run: python3 ./setupsrc/pypdfium2_setup/build_pdfium.py
- name: Build PDFium (with syslibs)
if: ${{ matrix.use_syslibs }}
run: |
sudo apt-get install -y libfreetype-dev liblcms2-dev libjpeg-dev libopenjp2-7-dev libpng-dev zlib1g-dev libicu-dev libtiff-dev
python3 ./setupsrc/pypdfium2_setup/build_pdfium.py --use-syslibs
- name: Install
run: PDFIUM_PLATFORM="sourcebuild" python3 -m pip install .
# must show matching pdfium version with sourcebuild origin
- name: Check version
run: pypdfium2 -v
- name: Run test suite
run: ./run test