.gitlab-ci.yml 1.98 KB
Newer Older
Erick Hitter's avatar
Erick Hitter committed
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

Erick Hitter's avatar
Erick Hitter committed
13
  # install the required packages for the running CI tests
Erick Hitter's avatar
Erick Hitter committed
14
  - |
Erick Hitter's avatar
Deps    
Erick Hitter committed
15
    apt-get -yqqf install lsb-release zip unzip subversion mysql-client libicu-dev libpng-dev libbz2-dev --fix-missing
Erick Hitter's avatar
Debug    
Erick Hitter committed
16

Erick Hitter's avatar
Typo    
Erick Hitter committed
17
    if [[ $(lsb_release -a) =~ "stretch" ]]; then
Erick Hitter's avatar
Erick Hitter committed
18
19
20
21
      apt-get -yqqf install default-libmysqlclient-dev --fix-missing
    else
      apt-get -yqqf install libmysqlclient-dev --fix-missing
    fi
Erick Hitter's avatar
Erick Hitter committed
22
23

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

27
28
  # Install Composer
  - curl -sS https://getcomposer.org/installer | php
Erick Hitter's avatar
Erick Hitter committed
29
30
  - mv composer.phar /usr/local/bin/composer
  - export PATH="$HOME/.composer/vendor/bin:$PATH"
31

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

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

Erick Hitter's avatar
Erick Hitter committed
43
  # Install PHPCS and WPCS
Erick Hitter's avatar
Erick Hitter committed
44
  - composer global require automattic/vipwpcs
Erick Hitter's avatar
Erick Hitter committed
45
46
47
48
49
50
51
  - 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:
52
53
    - phpcs
    - phpunit
Erick Hitter's avatar
Erick Hitter committed
54
  allow_failure: true
Erick Hitter's avatar
Erick Hitter committed
55
56

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

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

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

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