.gitlab-ci.yml 1.45 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
33
  when: manual
Erick Hitter's avatar
Erick Hitter committed
34
  allow_failure: true
Erick Hitter's avatar
Erick Hitter committed
35
36

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

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

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

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