Skip to content

Commit 49c7cd0

Browse files
authored
Fix/GitHub workflow (#1423)
Switch back to Ubuntu 22 and pull in imagick via action instead of installing manually.
1 parent 5d64da9 commit 49c7cd0

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

.github/workflows/run-tests.yml

+7-23
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ on: [ push, pull_request ]
44

55
jobs:
66
run:
7-
runs-on: ubuntu-latest
7+
runs-on: ubuntu-22.04
88
strategy:
99
fail-fast: false
1010
matrix:
1111
php: [ '8.1', '8.2', '8.3', '8.4' ]
1212
imagemagick: [ '6.9.12-55', '7.1.1-32' ]
13-
imagick: [ '3.7.0' ]
1413
stability: [ prefer-stable ]
1514

1615
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - ImageMagick ${{ matrix.imagemagick }}
@@ -19,13 +18,6 @@ jobs:
1918
- name: Checkout project
2019
uses: actions/checkout@v4
2120

22-
- name: Setup PHP
23-
uses: shivammathur/setup-php@v2
24-
with:
25-
php-version: ${{ matrix.php }}
26-
extensions: mbstring, gd
27-
coverage: none
28-
2921
- name: Prepare environment for Imagemagick
3022
run: |
3123
sudo apt-get -y remove imagemagick imagemagick-6-common libmagic-dev
@@ -60,20 +52,12 @@ jobs:
6052
sudo make install
6153
)
6254
63-
- name: Install PHP ImageMagick extension
64-
run: |
65-
curl -o /tmp/imagick.tgz -sL http://pecl.php.net/get/imagick-${{ matrix.imagick }}.tgz
66-
(
67-
cd /tmp || exit 1
68-
tar -xzf imagick.tgz
69-
cd imagick-${{ matrix.imagick }}
70-
phpize
71-
sudo ./configure --with-imagick=/home/runner/im/imagemagick-${{ matrix.imagemagick }}
72-
sudo make -j$(nproc)
73-
sudo make install
74-
)
75-
sudo bash -c 'echo "extension=imagick.so" >> /etc/php/${{ matrix.php }}/cli/php.ini'
76-
php --ri imagick;
55+
- name: Setup PHP
56+
uses: shivammathur/setup-php@v2
57+
with:
58+
php-version: ${{ matrix.php }}
59+
extensions: mbstring, gd, imagick
60+
coverage: none
7761

7862
- name: Get composer cache directory
7963
id: composer-cache

tests/BaseTestCase.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ protected function assertMediaType(string|array $allowed, string|EncodedImage $i
112112
fclose($pointer);
113113

114114
$allowed = is_string($allowed) ? [$allowed] : $allowed;
115-
$this->assertTrue(in_array($detected, $allowed));
115+
$this->assertTrue(
116+
in_array($detected, $allowed),
117+
'Detected media type "' . $detected . '" is not: ' . join(', ', $allowed),
118+
);
116119
}
117120

118121
protected function assertMediaTypeBitmap(string|EncodedImage $input): void

0 commit comments

Comments
 (0)