.gitlab-ci.yml 1.9 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 --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
29
  # Install Composer
  - curl -sS https://getcomposer.org/installer | php

Erick Hitter's avatar
Erick Hitter committed
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
Erick Hitter's avatar
Erick Hitter committed
32

Erick Hitter's avatar
Erick Hitter committed
33
34
  # PHPUnit
  - |
Erick Hitter's avatar
Debug    
Erick Hitter committed
35
    if [[ $(php -v) =~ "PHP 7." ]]; then
Erick Hitter's avatar
Erick Hitter committed
36
37
38
39
      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
40

Erick Hitter's avatar
Erick Hitter committed
41
  # Install PHPCS and WPCS
Erick Hitter's avatar
Erick Hitter committed
42
  - php composer.phar global require automattic/vipwpcs
Erick Hitter's avatar
Erick Hitter committed
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
Erick Hitter's avatar
Erick Hitter committed
52
  allow_failure: true
Erick Hitter's avatar
Erick Hitter committed
53
54

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

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

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

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