Skip to content

Commit

Permalink
Reduce workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Oct 27, 2024
1 parent 21934ed commit ff27d4b
Showing 1 changed file with 1 addition and 64 deletions.
65 changes: 1 addition & 64 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,77 +23,14 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, gd
extensions: mbstring, gd, imagick
coverage: none

- name: Prepare environment for Imagemagick
run: |
sudo apt-get -y remove imagemagick imagemagick-6-common libmagic-dev
sudo apt-get update
sudo apt-get install -y libjpeg-dev libgif-dev libtiff-dev libpng-dev libwebp-dev libavif-dev libheif-dev
sudo apt-get install -y libmagickwand-dev
- name: Cache ImageMagick
uses: actions/cache@v4
id: cache-imagemagick
with:
path: /home/runner/im/imagemagick-${{ matrix.imagemagick }}
key: ${{ runner.os }}-ImageMagick-${{ matrix.imagemagick }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-ImageMagick-${{ matrix.imagemagick }}-

- name: Check ImageMagick cache exists
uses: andstor/file-existence-action@v3
id: cache-imagemagick-exists
with:
files: /home/runner/im/imagemagick-${{ matrix.imagemagick }}

- name: Install ImageMagick
if: ( steps.cache-imagemagick.outputs.cache-hit != 'true' || steps.cache-imagemagick-exists.outputs.files_exists != 'true' )
run: |
curl -o /tmp/ImageMagick.tar.xz -sL https://imagemagick.org/archive/releases/ImageMagick-${{ matrix.imagemagick }}.tar.xz
(
cd /tmp || exit 1
tar xf ImageMagick.tar.xz
cd ImageMagick-${{ matrix.imagemagick }}
sudo ./configure --prefix=/home/runner/im/imagemagick-${{ matrix.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=/home/runner/im/imagemagick-${{ matrix.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 "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ matrix.stability }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ matrix.stability }}-

- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: Imagick Version
run: php -r 'var_dump(Imagick::getVersion());'

- name: Supported Imagick Formats
run: php -r 'var_dump(Imagick::queryFormats());'

- name: Execute tests
run: vendor/bin/phpunit --no-coverage

0 comments on commit ff27d4b

Please sign in to comment.