diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d68dce9e..57136c65 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -6,9 +6,16 @@ jobs: run: runs-on: ubuntu-latest strategy: - fail-fast: false + fail-fast: true matrix: - php: [ 8.0, 8.1 ] + php: [ '8.0', '8.1' ] + imagemagick: [ + '6.9.12-43', + '7.1.0-28' + ] + imagick: [ + '3.7.0' + ] stability: [ prefer-lowest, prefer-stable ] name: P${{ matrix.php }} - ${{ matrix.stability }} @@ -21,9 +28,55 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: mbstring, gd, imagick + extensions: mbstring, gd coverage: none + - name: Prepare environament for Imagemagick + run: | + sudo apt-get -y remove imagemagick imagemagick-6-common libmagic-dev + sudo apt-get update + sudo apt-get install -y libjpeg62-dev + sudo apt-get install -y libgif-dev + sudo apt-get install -y libtiff-dev + sudo apt-get install -y libpng-dev + sudo apt-get install -y libwebp-dev + sudo apt-get install -y libmagickwand-dev + + - name: Cache ImageMagick + uses: actions/cache@v2 + env: + cache-name: cache-ImageMagick + with: + path: ~/im/imagemagick-${{ matrix.imagemagick }} + key: ${{ runner.os }}-ImageMagick-${{ matrix.imagemagick }} + + - name: Install ImageMagick + run: | + curl -o /tmp/ImageMagick.tar.gz -sL https://www.imagemagick.org/download/ImageMagick-${{ matrix.imagemagick }}.tar.gz + ( + cd /tmp || exit 1 + tar xf ImageMagick.tar.gz + cd ImageMagick-${{ matrix.imagemagick }} + sudo ./configure --prefix=/opt/imagemagick + sudo make -j$(nproc) + sudo make install + ) + + - name: Install PHP ImageMagick extension + run: | + curl -o /tmp/imagick.tgz -sL http://pecl.php.net/get/imagick-${{ matrix.imagick }}.tgz + ( + cd /tmp || exit 1 + tar -xzf imagick.tgz + cd imagick-${{ matrix.imagick }} + phpize + sudo ./configure --with-imagick=/opt/imagemagick + sudo make -j$(nproc) + sudo make install + ) + sudo bash -c 'echo "extension=imagick.so" >> /etc/php/${{ matrix.php }}/cli/php.ini' + php --ri imagick; + - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" @@ -38,5 +91,8 @@ jobs: - name: Install dependencies run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction + - name: Which Imagick Version + run: php -r 'var_dump(Imagick::getVersion());' + - name: Execute tests run: vendor/bin/phpunit --no-coverage