.gitlab-ci.yml 1.85 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
variables:
  # Configure mysql service (https://hub.docker.com/_/mysql/)
  MYSQL_DATABASE: wordpress_tests
  MYSQL_ROOT_PASSWORD: mysql

before_script:
  # Install dependencies

  # update the docker
  - apt-get clean
  - apt-get -yqq update

13
  # install the required packages for the running CI tests
Erick Hitter's avatar
Erick Hitter committed
14 15 16 17 18 19 20 21
  - |
    apt-get -yqqf install zip unzip subversion mysql-client --fix-missing

    if [[ $(lsb_relase -a) =~ "stretch" ]]; then
      apt-get -yqqf install default-libmysqlclient-dev --fix-missing
    else
      apt-get -yqqf install libmysqlclient-dev --fix-missing
    fi
22 23

  # PHP extensions
Erick Hitter's avatar
Erick Hitter committed
24 25
  - docker-php-ext-install mbstring mysqli
  - docker-php-ext-enable mbstring mysqli intl gd zip bz2
26

27 28 29
  # Install Composer
  - curl -sS https://getcomposer.org/installer | php

30
  # Set up WordPress tests
Erick Hitter's avatar
Erick Hitter committed
31
  - bash bin/install-wp-tests.sh $MYSQL_DATABASE root $MYSQL_ROOT_PASSWORD mysql latest true
32

Erick Hitter's avatar
Erick Hitter committed
33 34 35 36 37 38 39
  # PHPUnit
  - |
    if [[ $(php -v) =~ "^PHP 7" ]]; then
      php composer.phar global require "phpunit/phpunit=6.1.*"
    else
      php composer.phar global require "phpunit/phpunit=4.8.*"
    fi
40

41
  # Install PHPCS and WPCS
42
  - php composer.phar global require automattic/vipwpcs
43 44 45 46 47 48 49
  - phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs,$HOME/.composer/vendor/automattic/vipwpcs

PHPunit:PHP5.3:MySQL:
  image: tetraweb/php:5.3
  services:
    - mysql:5.6
  script:
50 51
    - phpcs
    - phpunit
52
  allow_failure: true
53 54

PHPunit:PHP5.6:MySQL:
Erick Hitter's avatar
Erick Hitter committed
55
  image: php:5.6-stretch
56 57 58
  services:
    - mysql:5.6
  script:
59 60
    - phpcs
    - phpunit
61 62

PHPunit:PHP7.0:MySQL:
Erick Hitter's avatar
Erick Hitter committed
63
  image: php:7.0-stretch
64 65 66
  services:
    - mysql:5.6
  script:
67 68
    - phpcs
    - phpunit
69 70

PHPunit:PHP7.1:MySQL:
Erick Hitter's avatar
Erick Hitter committed
71
  image: php:7.1-stretch
72 73 74
  services:
    - mysql:5.6
  script:
75 76
    - phpcs
    - phpunit
77 78

PHPunit:PHP7.2:MySQL:
Erick Hitter's avatar
Erick Hitter committed
79
  image: php:7.2-stretch
80 81 82
  services:
    - mysql:5.6
  script:
83 84
    - phpcs
    - phpunit