Gitlab中的Wordpress CI

Ste*_*enV 3 wordpress continuous-integration gitlab gitlab-ci gitlab-ci-runner

是否有使用Gitlab CI 实现WorPress (WP_UnitTestCase)的参考?

我已经尝试配置.gitlab-ci.yml,它实现了构建,但是没有运行任何测试。

这是.gitlab-ci.yml文件:

image: php:5.6

variables:
  # Configure mysql service (https://hub.docker.com/_/mysql/)
  MYSQL_DATABASE: wordpress_tests
  MYSQL_ROOT_PASSWORD: mysql

before_script:
  # Install dependencies
  - bash ci/docker_install.sh wordpress_tests root mysql tutum-wordpress latest

stages:
  - test

# test:PHP5.3:MySQL:
#   image: tetraweb/php:5.3
#   script:
#   - phpunit --configuration phpunit.xml.dist

test:PHP5.4:MySQL:
  image: tetraweb/php:5.4
  services:
  - tutum/wordpress:latest
  script:
  - phpunit --configuration phpunit.xml.dist

# test:PHP5.6:MySQL:
#   image: php:5.6
#   script:
#   - phpunit --configuration phpunit.xml.dist

# test:PHP7:MySQL:
#   image: php:7
#   script:
#   - phpunit --configuration phpunit.xml.dist
Run Code Online (Sandbox Code Playgroud)

Nik*_*van 5

经过大量的试验和错误后,我发现它可以为我工作,对于在这里创建的测试插件,您可以看到针对PHP5.3至PHP7.0的测试正在正常运行

这就是我的.gitlab-ci.yml的样子。设置环境的shell脚本在这里

要在您的项目中使用此功能,只需将.gitlab-ci.yml,复制bin/install_gitlab_tests.sh到您的项目中。