Test Formulae #1525
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Test Formulae' | |
on: | |
workflow_dispatch: | |
inputs: | |
runner: | |
description: Build runner(s) (macOS version or Linux) | |
required: true | |
schedule: | |
- cron: '30 5 * * *' | |
jobs: | |
tests: | |
if: "!contains(github.event.head_commit.message, 'skip-test')" | |
runs-on: ${{ github.event.inputs.runner || 'macos-latest' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
php: ['7.2', '7.3', '7.4'] | |
extensions: ['amqp, apcu, ast, couchbase, ds, event, expect, gearman, gnupg, grpc, igbinary, imagick, imap, lua, mailparse, mcrypt, memcache, memcached, mongodb, msgpack, pdo_sqlsrv, pecl_http, protobuf, psr, raphf, rdkafka, redis, sqlsrv, snmp, ssh2, swoole, uuid, v8js, vips, vld, xdebug, yaml, xlswriter, zmq, pcov, propro'] | |
include: | |
- php: '5.6' | |
extensions: amqp, apcu, couchbase, event, expect, gnupg, gearman, grpc, igbinary, imagick, imap, lua, mailparse, mcrypt, memcache, memcached, mongodb, msgpack, pecl_http, protobuf, psr, raphf, rdkafka, redis, snmp, ssh2, swoole, uuid, vld, xdebug, yaml, zmq, propro | |
- php: '7.0' | |
extensions: amqp, apcu, ast, couchbase, ds, event, expect, gearman, gnupg, grpc, igbinary, imagick, imap, lua, mailparse, mcrypt, memcache, memcached, mongodb, msgpack, pdo_sqlsrv, pecl_http, protobuf, psr, raphf, rdkafka, redis, sqlsrv, snmp, ssh2, uuid, v8js, vips, vld, xdebug, yaml, xlswriter, zmq, propro | |
- php: '7.1' | |
extensions: amqp, apcu, ast, couchbase, ds, event, expect, gearman, gnupg, grpc, igbinary, imagick, imap, lua, mailparse, mcrypt, memcache, memcached, mongodb, msgpack, pdo_sqlsrv, pecl_http, protobuf, psr, raphf, rdkafka, redis, sqlsrv, snmp, ssh2, uuid, v8js, vips, vld, xdebug, yaml, xlswriter, zmq, pcov, propro | |
- php: '8.0' | |
extensions: amqp, apcu, ast, couchbase, ds, event, expect, gearman, gnupg, grpc, igbinary, imagick, imap, mailparse, mcrypt, memcache, memcached, mongodb, msgpack, pdo_sqlsrv, pecl_http, protobuf, psr, raphf, rdkafka, redis, sqlsrv, snmp, ssh2, swoole, v8js, uuid, vips, vld, xdebug, yaml, xlswriter, zmq, pcov | |
- php: '8.1' | |
extensions: amqp, apcu, ast, couchbase, ds, event, expect, gearman, gnupg, grpc, igbinary, imagick, imap, mailparse, mcrypt, memcache, memcached, mongodb, msgpack, pdo_sqlsrv, pecl_http, protobuf, psr, raphf, rdkafka, redis, sqlsrv, snmp, ssh2, swoole, v8js, uuid, vips, vld, xdebug, yaml, xlswriter, zmq, pcov | |
- php: '8.2' | |
extensions: amqp, apcu, ast, couchbase, ds, event, expect, gearman, gnupg, grpc, igbinary, imagick, imap, mailparse, mcrypt, memcache, memcached, mongodb, msgpack, pdo_sqlsrv, pecl_http, protobuf, psr, raphf, rdkafka, redis, sqlsrv, snmp, ssh2, swoole, v8js, uuid, vips, vld, xdebug, yaml, xlswriter, zmq, pcov | |
- php: '8.3' | |
extensions: amqp, apcu, ast, couchbase, ds, event, expect, gearman, gnupg, grpc, igbinary, imagick, imap, mcrypt, memcache, memcached, mongodb, msgpack, pdo_sqlsrv, pecl_http, protobuf, psr, raphf, rdkafka, redis, sqlsrv, snmp, ssh2, swoole, v8js, uuid, vips, vld, yaml, xlswriter, zmq, pcov | |
- php: '8.4' | |
extensions: amqp, apcu, ast, couchbase, ds, event, expect, gearman, gnupg, grpc, igbinary, imagick, imap, mcrypt, memcache, memcached, mongodb, msgpack, pdo_sqlsrv, pecl_http, protobuf, psr, raphf, rdkafka, redis, sqlsrv, snmp, ssh2, swoole, uuid, vips, yaml, xlswriter, zmq, pcov | |
- php: '7.2' | |
extensions: xdebug2 | |
- php: '7.3' | |
extensions: xdebug2 | |
- php: '7.4' | |
extensions: xdebug2 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup cache environment | |
uses: shivammathur/cache-extensions@develop | |
env: | |
skip_dependency_extensions: true | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: ${{ matrix.extensions }} | |
key: homebrew-extensions-all-v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@develop | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: ${{ matrix.extensions }} | |
env: | |
update: true | |
- name: Testing PHP version | |
run: | | |
php -v | |
php -r "if(strpos(phpversion(), '${{ matrix.php }}') === false) {throw new Exception('Wrong PHP version Installed');}" | |
- name: Testing Extensions | |
if: matrix.extensions != 'xdebug2' | |
run: | | |
php -m | |
php -r "if(substr(phpversion(), 0, 3)<8.0 && ! extension_loaded('propro')) {throw new Exception('propro not found');}" | |
php -r "if(phpversion()>=7.0 && ! extension_loaded('ast')) {throw new Exception('ast not found');}" | |
php -r "if(phpversion()>=7.1 && ! extension_loaded('pcov')) {throw new Exception('pcov not found');}" | |
php -r "if(phpversion()>=7.0 && ! extension_loaded('vips')) {throw new Exception('vips not found');}" | |
php -r "if(phpversion()<8.3 && ! extension_loaded('mailparse')) {throw new Exception('mailparse not found');}" | |
php -r "if(phpversion()<8.4 && ! extension_loaded('vld')) {throw new Exception('vld not found');}" | |
php -r "if(phpversion()<8.3 && ! extension_loaded('xdebug')) {throw new Exception('xdebug not found');}" | |
php -r "if(! extension_loaded('amqp')) {throw new Exception('amqp not found');}" | |
php -r "if(! extension_loaded('apcu')) {throw new Exception('apcu not found');}" | |
php -r "if(! extension_loaded('couchbase')) {throw new Exception('couchbase not found');}" | |
php -r "if(! extension_loaded('expect')) {throw new Exception('expect not found');}" | |
php -r "if(! extension_loaded('gnupg')) {throw new Exception('gnupg not found');}" | |
php -r "if(! extension_loaded('grpc')) {throw new Exception('grpc not found');}" | |
php -r "if(! extension_loaded('http')) {throw new Exception('http not found');}" | |
php -r "if(! extension_loaded('igbinary')) {throw new Exception('igbinary not found');}" | |
php -r "if(! extension_loaded('imagick')) {throw new Exception('imagick not found');}" | |
php -r "if(! extension_loaded('imap')) {throw new Exception('imap not found');}" | |
php -r "if(! extension_loaded('mcrypt')) {throw new Exception('mcrypt not found');}" | |
php -r "if(! extension_loaded('memcache')) {throw new Exception('memcache not found');}" | |
php -r "if(! extension_loaded('memcached')) {throw new Exception('memcached not found');}" | |
php -r "if(! extension_loaded('mongodb')) {throw new Exception('mongodb not found');}" | |
php -r "if(! extension_loaded('msgpack')) {throw new Exception('msgpack not found');}" | |
php -r "if(! extension_loaded('protobuf')) {throw new Exception('protobuf not found');}" | |
php -r "if(! extension_loaded('raphf')) {throw new Exception('raphf not found');}" | |
php -r "if(! extension_loaded('rdkafka')) {throw new Exception('rdkafka not found');}" | |
php -r "if(! extension_loaded('redis')) {throw new Exception('redis not found');}" | |
php -r "if(! extension_loaded('protobuf')) {throw new Exception('protobuf not found');}" | |
php -r "if(! extension_loaded('psr')) {throw new Exception('psr not found');}" | |
php -r "if(! extension_loaded('snmp')) {throw new Exception('snmp not found');}" | |
php -r "if(! extension_loaded('ssh2')) {throw new Exception('ssh2 not found');}" | |
php -r "if(! extension_loaded('uuid')) {throw new Exception('uuid not found');}" | |
php -r "if(! extension_loaded('yaml')) {throw new Exception('yaml not found');}" | |
php -r "if(! extension_loaded('zmq')) {throw new Exception('zmq not found');}" | |
# Check if inputs.runner doesn't have arm64 in it or if matrix.php is not 7.0 and 7.1 | |
if ! [[ "$(arch)" = "arm64" && "${{ matrix.php }}" =~ ^(7.0|7.1)$ ]]; then | |
php -r "if(! extension_loaded('swoole')) {throw new Exception('swoole not found');}" | |
fi | |
- name: Testing Xdebug2 | |
if: matrix.extensions == 'xdebug2' | |
run: php -r "if(phpversion('xdebug')!='2.9.8') {throw new Exception('xdebug2 not found');}" | |
- name: Testing Linkage | |
run: | | |
IFS=', ' read -ra extensions <<< "${{ matrix.extensions }}" | |
for extension in "${extensions[@]}"; do | |
echo "::group::$extension" | |
brew linkage "shivammathur/extensions/$extension@${{ matrix.php }}" | |
echo "::endgroup::" | |
done | |