Skip to content

Detection for vips 1 not longer works #117

Detection for vips 1 not longer works

Detection for vips 1 not longer works #117

Workflow file for this run

name: PHPStan and PHPUnit tests
on:
push:
pull_request:
jobs:
tests:
name: PHP ${{ matrix.php }} ${{ matrix.settings }} ${{ matrix.COMPOSER_FLAGS }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1']
settings: ['both', 'vips-only', 'ffi-only']
COMPOSER_FLAGS: ['']
include:
- php: '7.2'
settings: 'vips-only'
- php: '7.3'
settings: 'vips-only'
- php: '8.0'
COMPOSER_FLAGS: "--prefer-lowest"
settings: 'vips-only'
- php: '8.0'
COMPOSER_FLAGS: "--prefer-lowest"
settings: 'both'
- php: '8.0'
COMPOSER_FLAGS: "--prefer-lowest"
settings: 'ffi-only'
# currently fails on PHP 8.2 with vips-only, due to https://github.com/libvips/php-vips/pull/174
# once php-vips 1.0.10 is out, we can enable tests for PHP 8.2 for all "settings" and put this above in matrix.php
- php: '8.2'
settings: 'ffi-only'
- php: '8.2'
settings: 'both'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get Settings
id: set_var
run: |
echo "SETTINGS_JSON=$(jq -c . < .github/workflows/settings/${{ matrix.settings }}.json)" >> $GITHUB_ENV
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
ini-values: ${{fromJson(env.SETTINGS_JSON).ini_values}}
coverage: none
extensions: ${{fromJson(env.SETTINGS_JSON).extensions}}
- name: Install vips
run: sudo apt install -y ${{fromJson(env.SETTINGS_JSON).aptinstall}} --no-install-recommends
- name: Install vips extension
run: sudo pecl install vips
if: fromJson(env.SETTINGS_JSON).aptinstall == 'libvips-dev'
- name: Install vips ext config
run: echo "extension=vips.so" >> $(php -i | grep /.+/php.ini -oE)
if: fromJson(env.SETTINGS_JSON).aptinstall == 'libvips-dev'
- name: Install composer dependencies
run: |
composer update --prefer-dist --no-interaction --no-progress --no-ansi ${{ matrix.COMPOSER_FLAGS || '' }}
- name: Debug PHP settings
run: |
php -r 'echo "Has VIPS Extension: " . (extension_loaded("vips") ? "true" : "false") . PHP_EOL; echo "Has FFI Extension: " . (extension_loaded("ffi") ? "true" : "false") . PHP_EOL; echo "Has FFI Class: " . (class_exists(FFI::class) ? "true" : "false") . PHP_EOL; echo "Has FFI Enabled: " . (ini_get("ffi.enable") === "1" ? "true" : "false") . PHP_EOL; echo "Has zend.max_allowed_stack_size correct: " . (ini_get("zend.max_allowed_stack_size") === "-1" ? "true" : "false") . PHP_EOL;'
- name: PHPStan
run: composer phpstan
- name: PHPUnit
run: composer phpunit
- name: Composer audit
run: composer audit