language: bash
services: docker

env:
  - PACKAGE=php IMAGE=php-7.1-fpm
  - PACKAGE=php IMAGE=php-7.2-fpm
  - PACKAGE=php IMAGE=php-7.3-fpm
  - PACKAGE=php IMAGE=php-7.3-swoole

before_script:
  - env | sort
  - cd "$PACKAGE"

script:
  - |
    (
      set -Eeuo pipefail
      set -x
      docker build -t "$IMAGE" -f "$IMAGE" .
      docker run -ti --rm "$IMAGE" php --version
      docker run -ti --rm "$IMAGE" php --ini
      docker run -ti --rm "$IMAGE" php -m
    )

language: bash
services: docker

env:
  - PACKAGE=php VERSION=php-7.1-fpm
  - PACKAGE=php VERSION=php-7.2-fpm
  - PACKAGE=php VERSION=php-7.3-fpm
  - PACKAGE=php VERSION=php-7.3-swoole

before_script:
  - env | sort
  - cd "$PACKAGE"

script:
  - |
    (
      set -Eeuo pipefail
      set -x
      docker build --quiet -t "$VERSION" -f "$VERSION" .
      docker run -ti --rm "$VERSION" php --version
      docker run -ti --rm "$VERSION" php --ini
      docker run -ti --rm "$VERSION" php -m
      docker run --rm "$VERSION" php -m | grep bcmath
      docker run --rm "$VERSION" php -m | grep exif
      docker run --rm "$VERSION" php -m | grep gd
      docker run --rm "$VERSION" php -m | grep intl
      docker run --rm "$VERSION" php -m | grep mbstring
      docker run --rm "$VERSION" php -m | grep mysqli
      docker run --rm "$VERSION" php -m | grep mysqlnd
      docker run --rm "$VERSION" php -m | grep pcntl
      docker run --rm "$VERSION" php -m | grep pdo_mysql
      docker run --rm "$VERSION" php -m | grep redis
      docker run --rm "$VERSION" php -m | grep OPcache
    )

Check php extensions are installed
CI: Check php extensions are installed
