.gitlab-ci.yml 1.14 KB
Newer Older
1 2 3 4 5
variables:
  # Configure mysql service (https://hub.docker.com/_/mysql/)
  MYSQL_DATABASE: wordpress_tests
  MYSQL_ROOT_PASSWORD: mysql

Erick Hitter's avatar
Erick Hitter committed
6 7 8
cache:
  paths:
    - $HOME/.composer
Erick Hitter's avatar
Erick Hitter committed
9
    - /root/.composer
Erick Hitter's avatar
Erick Hitter committed
10

11 12
before_script:
  # Set up WordPress tests
Erick Hitter's avatar
Erick Hitter committed
13
  - bash bin/install-wp-tests.sh $MYSQL_DATABASE root $MYSQL_ROOT_PASSWORD mysql latest true
14

Erick Hitter's avatar
Erick Hitter committed
15 16
  # PHPUnit
  - |
Erick Hitter's avatar
Erick Hitter committed
17
    if [[ $(php -v) =~ "PHP 7." ]]; then
Erick Hitter's avatar
Erick Hitter committed
18
      composer global require "phpunit/phpunit=6.1.*"
Erick Hitter's avatar
Erick Hitter committed
19
    else
Erick Hitter's avatar
Erick Hitter committed
20
      composer global require "phpunit/phpunit=4.8.*"
Erick Hitter's avatar
Erick Hitter committed
21
    fi
22

23
  # Install PHPCS and WPCS
Erick Hitter's avatar
Erick Hitter committed
24
  - composer global require automattic/vipwpcs
25 26 27
  - phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs,$HOME/.composer/vendor/automattic/vipwpcs

PHPunit:PHP7.0:MySQL:
28
  image: containers.ethitter.com:443/docker/images/php:7.0
29 30 31
  services:
    - mysql:5.6
  script:
Erick Hitter's avatar
Erick Hitter committed
32
    - phpcs -n
33
    - phpunit
34 35

PHPunit:PHP7.1:MySQL:
36
  image: containers.ethitter.com:443/docker/images/php:7.1
37 38 39
  services:
    - mysql:5.6
  script:
Erick Hitter's avatar
Erick Hitter committed
40
    - phpcs -n
41
    - phpunit
42 43

PHPunit:PHP7.2:MySQL:
44
  image: containers.ethitter.com:443/docker/images/php:7.2
45 46 47
  services:
    - mysql:5.6
  script:
Erick Hitter's avatar
Erick Hitter committed
48
    - phpcs -n
49
    - phpunit