.gitlab-ci.yml 2.33 KB
Newer Older
1 2 3 4
variables:
  # Configure mysql service (https://hub.docker.com/_/mysql/)
  MYSQL_DATABASE: wordpress_tests
  MYSQL_ROOT_PASSWORD: mysql
Erick Hitter's avatar
Erick Hitter committed
5
  WP_VERSION: latest
6

Erick Hitter's avatar
Erick Hitter committed
7 8 9
cache:
  paths:
    - $HOME/.composer
Erick Hitter's avatar
Erick Hitter committed
10
    - /root/.composer
Erick Hitter's avatar
Erick Hitter committed
11

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

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

24
PHPunit:PHP5.3:MySQL:
Erick Hitter's avatar
Erick Hitter committed
25 26 27
  stage: test
  variables:
    WP_VERSION: '5.1'
28
  image: containers.ethitter.com:443/docker/images/php:5.3
29 30 31
  services:
    - mysql:5.6
  script:
Erick Hitter's avatar
Erick Hitter committed
32
    - find . -type "f" -iname "*.php" | xargs -L "1" php -l
33
    - phpunit
34 35

PHPunit:PHP5.6:MySQL:
Erick Hitter's avatar
Erick Hitter committed
36
  stage: test
37
  image: containers.ethitter.com:443/docker/images/php:5.6
38 39 40
  services:
    - mysql:5.6
  script:
Erick Hitter's avatar
Erick Hitter committed
41
    - find . -type "f" -iname "*.php" | xargs -L "1" php -l
42
    - phpunit
43 44

PHPunit:PHP7.0:MySQL:
Erick Hitter's avatar
Erick Hitter committed
45
  stage: test
46
  image: containers.ethitter.com:443/docker/images/php:7.0
47 48 49
  services:
    - mysql:5.6
  script:
Erick Hitter's avatar
Erick Hitter committed
50
    - find . -type "f" -iname "*.php" | xargs -L "1" php -l
51
    - phpunit
52 53

PHPunit:PHP7.1:MySQL:
Erick Hitter's avatar
Erick Hitter committed
54
  stage: test
55
  image: containers.ethitter.com:443/docker/images/php:7.1
56 57 58
  services:
    - mysql:5.6
  script:
Erick Hitter's avatar
Erick Hitter committed
59
    - find . -type "f" -iname "*.php" | xargs -L "1" php -l
60
    - phpunit
61 62

PHPunit:PHP7.2:MySQL:
Erick Hitter's avatar
Erick Hitter committed
63
  stage: test
64
  image: containers.ethitter.com:443/docker/images/php:7.2
65 66 67
  services:
    - mysql:5.6
  script:
Erick Hitter's avatar
Erick Hitter committed
68
    - find . -type "f" -iname "*.php" | xargs -L "1" php -l
69
    - phpunit
Erick Hitter's avatar
Erick Hitter committed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88

PHPunit:PHP7.3:MySQL:
  stage: test
  image: containers.ethitter.com:443/docker/images/php:7.3
  services:
    - mysql:5.6
  script:
    - find . -type "f" -iname "*.php" | xargs -L "1" php -l
    - phpunit

PHPCS:
  stage: test
  image: containers.ethitter.com:443/docker/images/php:7.3
  before_script:
    - composer global require automattic/vipwpcs
    - composer global require phpcompatibility/phpcompatibility-wp
    - phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs,$HOME/.composer/vendor/automattic/vipwpcs,$HOME/.composer/vendor/phpcompatibility/php-compatibility,$HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie,$HOME/.composer/vendor/phpcompatibility/phpcompatibility-wp
  script:
    - phpcs -n