Functional Tests #628
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
name: Functional Tests | |
on: | |
pull_request: | |
workflow_run: | |
workflows: ["Test Code Samples"] | |
branches: | |
- '*' | |
types: | |
- completed | |
# Allows running this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
MINDEE_ACCOUNT_SE_TESTS: ${{ secrets.MINDEE_ACCOUNT_SE_TESTS }} | |
MINDEE_ENDPOINT_SE_TESTS: ${{ secrets.MINDEE_ENDPOINT_SE_TESTS }} | |
MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }} | |
WORKFLOW_ID: ${{ secrets.WORKFLOW_ID_SE_TESTS }} | |
jobs: | |
functional-tests-ubuntu: | |
name: Run Functional Tests on Ubuntu | |
timeout-minutes: 30 | |
strategy: | |
max-parallel: 2 | |
matrix: | |
php-version: | |
- 7.4 | |
- 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 }} | |
extensions: curl, fileinfo, json, imagick | |
- 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 | |
run: | | |
./vendor/bin/phpunit -c tests/functional.xml | |
functional-tests-macos: | |
name: Run Functional Tests on MacOS | |
timeout-minutes: 30 | |
strategy: | |
max-parallel: 2 | |
matrix: | |
php-version: | |
- 7.4 | |
- 8.3 | |
runs-on: "macos-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- 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 | |
- name: Install ImageMagick | |
run: | | |
brew update | |
brew install imagemagick | |
- uses: ramsey/composer-install@v2 | |
- name: Unit testing with phpunit | |
run: | | |
./vendor/bin/phpunit -c tests/functional.xml | |
functional-tests-windows: | |
name: Run Functional Tests on Windows | |
timeout-minutes: 30 | |
strategy: | |
max-parallel: 2 | |
matrix: | |
php-version: | |
- 7.4 | |
- 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: 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 | |
- name: Install Ghostscript | |
run: choco install ghostscript -y | |
- uses: ramsey/composer-install@v2 | |
- name: Unit testing with phpunit | |
run: | | |
./vendor/bin/phpunit -c tests/functional.xml |