Skip to content

Commit

Permalink
update CI to run inside container
Browse files Browse the repository at this point in the history
  • Loading branch information
deluxetom committed Dec 31, 2024
1 parent c061552 commit 42d1af9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ jobs:
matrix:
php: [ '8.1', '8.2', '8.3', '8.4' ]
stability: [ prefer-stable ]
container:
image: php:${{ matrix.php }}-cli

name: PHP ${{ matrix.php }} - ${{ matrix.stability }}

steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Install vips
run: sudo apt install -y --no-install-recommends libvips42 libffi-dev libexif-dev zip unzip

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -25,9 +30,6 @@ jobs:
tools: composer:v2
coverage: none

- name: Install vips
run: sudo apt install -y libvips --no-install-recommends

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
Expand Down
4 changes: 2 additions & 2 deletions src/Decoders/NativeObjectDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\SpecializedInterface;
use Intervention\Image\MediaType;
use Jcupitt\Vips\Exception;
use Jcupitt\Vips\Exception as VipsException;
use Jcupitt\Vips\Image as VipsImage;

class NativeObjectDecoder extends SpecializableDecoder implements SpecializedInterface
Expand Down Expand Up @@ -76,7 +76,7 @@ protected function vipsMediaType(VipsImage $vips): ?MediaType
{
try {
$loader = $vips->get('vips-loader');
} catch (Exception) {
} catch (VipsException) {
return null;
}

Expand Down
4 changes: 3 additions & 1 deletion tests/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ protected function assertTransparency(ColorInterface $color): void

protected function assertImageSize(string|EncodedImage $image, int $width, int $height): void
{
$vipsImage = VipsImage::newFromBuffer((string) $image, 'n=-1', ['access' => Access::SEQUENTIAL,]);
$vipsImage = VipsImage::newFromBuffer((string) $image, 'n=-1', [
'access' => Access::SEQUENTIAL,
]);

$detectedWidth = $vipsImage->width;
$detectedHeight = $vipsImage->getType('page-height') === 0 ?
Expand Down

0 comments on commit 42d1af9

Please sign in to comment.