Read PDF metadata from a dedicated Imagick instance #523
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: run-tests | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| php: [8.5, 8.4, 8.3, 8.2] | |
| dependency-version: [prefer-lowest, prefer-stable] | |
| os: [ubuntu-latest] | |
| name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} | |
| steps: | |
| - name: Upgrade ghostscript | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install ghostscript | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick | |
| coverage: pcov | |
| - name: Fix Imagick Policy | |
| run: | | |
| sudo sed -i 's/none/read|write/g' /etc/ImageMagick-6/policy.xml | |
| sudo sed -i -E 's/[0-9]+MP"/3GiB"/g' /etc/ImageMagick-6/policy.xml | |
| - name: Install dependencies | |
| run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction | |
| - name: Setup Problem Matches | |
| run: | | |
| echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
| echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
| - name: Execute tests | |
| run: vendor/bin/pest --parallel | |
| # The runner images only ship ImageMagick 6, which cannot open password-protected PDFs, | |
| # so the password tests skip there. This job runs the suite on a distro that packages | |
| # ImageMagick 7, where those tests actually execute. | |
| test-password-protected-pdfs: | |
| runs-on: ubuntu-latest | |
| container: debian:trixie | |
| name: Password-protected PDFs - ImageMagick 7 | |
| steps: | |
| - name: Install ImageMagick 7, PHP and ghostscript | |
| run: | | |
| apt-get update | |
| apt-get install -y php-cli php-imagick php-xml php-mbstring php-zip php-curl php-pcov ghostscript composer git unzip | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Fix Imagick Policy | |
| run: | | |
| sed -i 's/rights="none"/rights="read|write"/g' /etc/ImageMagick-7/policy.xml | |
| sed -i -E 's/[0-9]+MP"/3GiB"/g' /etc/ImageMagick-7/policy.xml | |
| - name: Install dependencies | |
| run: composer update --prefer-dist --no-interaction | |
| - name: Execute tests | |
| run: vendor/bin/pest --parallel |