Skip to content

♻️ add test coverage for failed jobs (#111) #583

♻️ add test coverage for failed jobs (#111)

♻️ add test coverage for failed jobs (#111) #583

Workflow file for this run

name: Unit Tests with PDF features
on:
push:
# Allows running this workflow manually from the Actions tab
workflow_dispatch:
jobs:
phpunit-ubuntu:
name: Run Unit Tests on Ubuntu
timeout-minutes: 30
strategy:
matrix:
php-version:
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Ghostscript
run: |
sudo apt-get update
sudo apt-get install -y ghostscript
- name: Set up php ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- uses: ramsey/composer-install@v2
- name: Change ImageMagick security policy on Ubuntu
run: |
DQT='"'
SRC="rights=${DQT}none${DQT} pattern=${DQT}PDF${DQT}"
RPL="rights=${DQT}read|write${DQT} pattern=${DQT}PDF${DQT}"
sudo sed -i "s/$SRC/$RPL/" /etc/ImageMagick-6/policy.xml
- name: Unit testing with phpunit
env:
MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
run: |
./vendor/bin/phpunit -c tests/phpunit.xml
phpunit-macos:
name: Run Unit Tests on MacOS
timeout-minutes: 30
strategy:
matrix:
php-version:
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Homebrew
run: |
brew update
brew upgrade
brew uninstall -f imagemagick || true
brew uninstall -f pkg-config || true
brew cleanup
- name: Install Imagemagick
run: |
brew install pkg-config imagemagick@7
export PKG_CONFIG_PATH="/usr/local/opt/imagemagick/lib/pkgconfig"
- name: Set up php ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
env:
phpts: zts
with:
php-version: ${{ matrix.php-version }}
- name: Install Imagick
run: pecl install imagick
- uses: ramsey/composer-install@v2
- name: Unit testing with phpunit
env:
MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
run: |
./vendor/bin/phpunit -c tests/phpunit.xml
phpunit-windows:
name: Run Unit Tests on Windows
timeout-minutes: 30
strategy:
matrix:
php-version:
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
runs-on: "windows-latest"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Ghostscript
run: choco install ghostscript --version 10.03.1 -y
- name: Create Ghostscript alias
run: |
New-Item -ItemType SymbolicLink -Path "C:\Windows\gs.exe" -Target "C:\Program Files\gs\gs10.03.1\bin\gswin64c.exe"
New-Item -ItemType SymbolicLink -Path "C:\Windows\gs" -Target "C:\Program Files\gs\gs10.03.1\bin\gswin64c.exe"
shell: powershell
- name: Set up php ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
env:
phpts: zts
with:
php-version: ${{ matrix.php-version }}
extensions: curl, fileinfo, json, imagick
- uses: ramsey/composer-install@v2
- name: Unit testing with phpunit
env:
MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }}
run: |
./vendor/bin/phpunit -c tests/phpunit.xml