.gitlab-ci.yml 1.14 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
cache:
  paths:
    - $HOME/.composer
Erick Hitter's avatar
Erick Hitter committed
9
    - /root/.composer
Erick Hitter's avatar
Cleanup    
Erick Hitter committed
10

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

Erick Hitter's avatar
Erick Hitter committed
15
16
  # PHPUnit
  - |
Erick Hitter's avatar
Debug    
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
Erick Hitter's avatar
Erick Hitter committed
22

Erick Hitter's avatar
Erick Hitter committed
23
  # Install PHPCS and WPCS
Erick Hitter's avatar
Erick Hitter committed
24
  - composer global require automattic/vipwpcs
Erick Hitter's avatar
Erick Hitter committed
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
Erick Hitter's avatar
Erick Hitter committed
29
30
31
  services:
    - mysql:5.6
  script:
Erick Hitter's avatar
Erick Hitter committed
32
    - phpcs -n
33
    - phpunit
Erick Hitter's avatar
Erick Hitter committed
34
35

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

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