.gitlab-ci.yml 1.6 KB
Newer Older
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
Erick Hitter committed
6 7 8 9
cache:
  paths:
    - $HOME/.composer
    - /root/.composer
10

Erick Hitter's avatar
Erick Hitter committed
11
before_script:
12
  # 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
14

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

Erick Hitter's avatar
Erick Hitter committed
23 24 25 26
  # Install PHPCS and WPCS
  - 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
27 28

PHPunit:PHP7.2:MySQL:
29
  stage: test
Erick Hitter's avatar
Erick Hitter committed
30
  image: containers.ethitter.com:443/docker/images/php:7.2
31 32 33
  services:
    - mysql:5.6
  script:
Erick Hitter's avatar
Erick Hitter committed
34 35 36
    - find . -type "f" -iname "*.php" | xargs -L "1" php -l
    - phpcs -n
    - phpunit
37

Erick Hitter's avatar
Erick Hitter committed
38
PHPunit:PHP7.3:MySQL:
39
  stage: test
Erick Hitter's avatar
Erick Hitter committed
40 41 42 43 44 45 46
  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
    - phpcs -n
    - phpunit
47

48 49
PluginSVN:
  stage: deploy
50
  image: containers.ethitter.com:443/docker/images/php:7.3
51
  before_script:
52
    - apt-get update
53
    - apt-get install -y rsync
54 55 56 57
  script: ./bin/deploy.sh
  when: on_success
#  only:
#    - master