.gitlab-ci.yml 1.41 KB
Newer Older
Erick Hitter's avatar
Erick Hitter committed
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
Cleanup    
Erick Hitter committed
6
7
8
9
cache:
  paths:
    - $HOME/.composer

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

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

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

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

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

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

PHPunit:PHP7.1:MySQL:
51
  image: containers.ethitter.com:443/docker/images/php:7.1
Erick Hitter's avatar
Erick Hitter committed
52
53
54
  services:
    - mysql:5.6
  script:
Erick Hitter's avatar
Erick Hitter committed
55
    - phpcs -n
56
    - phpunit
Erick Hitter's avatar
Erick Hitter committed
57
58

PHPunit:PHP7.2:MySQL:
59
  image: containers.ethitter.com:443/docker/images/php:7.2
Erick Hitter's avatar
Erick Hitter committed
60
61
62
  services:
    - mysql:5.6
  script:
Erick Hitter's avatar
Erick Hitter committed
63
    - phpcs -n
64
    - phpunit