.gitlab-ci.yml 1.88 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
Erick Hitter committed
15
    apt-get -yqqf install lsb-release zip unzip subversion mysql-client --fix-missing
Erick Hitter's avatar
Debug    
Erick Hitter committed
16
17
    lsb_release -a

Erick Hitter's avatar
Typo    
Erick Hitter committed
18
    if [[ $(lsb_release -a) =~ "stretch" ]]; then
Erick Hitter's avatar
Erick Hitter committed
19
20
21
22
      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
23
24

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

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

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

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

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

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

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

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

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