Test Sourcebuild #49
This file contains 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
# SPDX-FileCopyrightText: 2025 geisserml <[email protected]> | |
# 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 | |
# FIXME Google's toolchain doesn't seem to run on Linux arm64 natively | |
# os: ['ubuntu-latest', 'macos-13', 'macos-14', 'windows-latest'] # 'ubuntu-24.04-arm' | |
# use_syslibs: [false] | |
# include: | |
# - os: 'ubuntu-latest' | |
# use_syslibs: [true] | |
# # - os: 'ubuntu-24.04-arm' | |
# # use_syslibs: [true] | |
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/sourcebuild.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 libglib2.0-dev | |
python3 ./setupsrc/pypdfium2_setup/sourcebuild.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 |