language: php

services:
    - mysql

php:
    - 8.0
    - 7.4
    - 5.6

install: composer install

before_script:
    - composer validate --strict
    - mkdir -p build/logs
    - mysql -e 'CREATE DATABASE wp_cli_test;' -uroot
    - mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"localhost" IDENTIFIED BY "password1"' -uroot

script: composer test

cache:
  directories:
    - vendor

notifications:
    email:
        on_success: never
        on_failure: change
