1 Star 0 Fork 21

鲜虾鱼板面2014/SuiteCRM

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.travis.yml 4.77 KB
一键复制 编辑 原始数据 按行查看 历史
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
matrix:
fast_finish: true
jobs:
include:
- stage: codecoverage
if: type IN (pull_request) OR branch in (master, develop, hotfix)
php: 7.0
script: ./vendor/bin/codecept run install --env travis-ci-hub -f --ext DotReporter; ./vendor/bin/robo code:coverage; cat codeception.yml; bash <(curl -s https://codecov.io/bash) -f ./_output/coverage.xml
sudo: required
dist: trusty
services:
- mysql
- elasticsearch
addons:
chrome: stable
cache:
directories:
- $HOME/.composer/cache/files
env:
- INSTANCE_URL=http://localhost DATABASE_DRIVER=MYSQL DATABASE_NAME=automated_tests DATABASE_HOST=localhost DATABASE_USER=automated_tests DATABASE_PASSWORD=automated_tests INSTANCE_ADMIN_USER=admin INSTANCE_ADMIN_PASSWORD=admin1 COMPOSER_MEMORY_LIMIT=-1
before_install:
# Install chrome driver#
- whereis google-chrome-stable
- wget https://chromedriver.storage.googleapis.com/2.36/chromedriver_linux64.zip
- unzip -o chromedriver_linux64.zip
- ./chromedriver --url-base=/wd/hub &
# Lint PHP
- for file in $(git diff --name-status HEAD~1 HEAD | egrep "^[ACMR].*\.php$" | cut -c 3-); do php -l $file; done
install:
- phpenv config-add travis.php.ini
- composer self-update && composer --version
before_script:
# Set up MySQL
- mysql -e "CREATE DATABASE automated_tests CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
- mysql -u root -e "CREATE USER 'automated_tests'@'localhost' IDENTIFIED BY 'automated_tests';"
- mysql -u root -e "GRANT ALL PRIVILEGES ON automated_tests.* TO 'automated_tests'@'localhost';"
# Install apache - images with PHP 7 or above
- sudo apt-get update
- sudo apt-get install apache2 libapache2-mod-fastcgi
# Enable php-fpm - images with PHP 7 or above
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf 2>/dev/null || true
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# Configure apache virtual hosts - images with PHP 7 or above
- sudo cp -f build/travis-ci-apache /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
# Additional PHP config
- phpenv config-add travis.php.ini
- sudo service apache2 restart
# Install composer
- composer install
- ./vendor/bin/codecept build
script:
# Run the wizard installer
- echo "using install wizard"
- ./vendor/bin/codecept run install --env travis-ci-hub -f --ext DotReporter
- ./build/push_output.sh
# Run the unit tests
# - ./vendor/bin/codecept run unit --steps -f -vvv -d
- sudo chmod -R 777 .
- echo "\$sugar_config['state_checker']['test_state_check_mode'] = 2;" >> config_override.php
- echo "\$sugar_config['show_log_trace'] = true;" >> config_override.php
- echo "\$sugar_config['logger']['level'] = 'fatal';" >> config_override.php
- cd tests
- ../vendor/bin/phpunit --stop-on-failure --stop-on-error --colors --configuration $(pwd)/phpunit.xml.dist ./tests/unit/phpunit
- cd ..
# Install OAuth2 demo data
- mysql -u root -D automated_tests -v -e "source tests/_data/api_data.sql"
# Install demo user data
- mysql -u root -D automated_tests -v -e "source tests/_data/demo_users.sql"
# set the log level to error
- echo "\$sugar_config['logger']['level'] = 'error';" >> config_override.php
# add keys
- sudo chmod -R 777 .
- openssl genrsa -out Api/V8/OAuth2/private.key 2048
- openssl rsa -in Api/V8/OAuth2/private.key -pubout -out Api/V8/OAuth2/public.key
- sudo chmod 600 Api/V8/OAuth2/p*.key
# - sudo chown www-data:www-data Api/V8/OAuth2/p*.key
# Run API functional tests
- ./vendor/bin/codecept run tests/api/V8/ -f --ext DotReporter
# RUN Basic Acceptance test
- echo "\$sugar_config['imap_test'] = true;" >> config_override.php
- ./vendor/bin/codecept run acceptance --env travis-ci-hub -f --ext DotReporter
after_script:
- ./build/push_output.sh
- curl -i -F file=@suitecrm.log https://www.simpleupload.co.uk/Api/FileUpload.php?d=upload
- curl -i -F file=@var/log/apache2/error.log https://www.simpleupload.co.uk/Api/FileUpload.php?d=upload
# ElasticSearch Indexing logs
- cat search_index.log
- sudo cat /var/log/apache2/error.log
- echo $TRAVIS_COMMIT_RANGE
branches:
only:
- master
- develop
- /hotfix.*/
- /feature.*/
- /fix.*/
- /staging.*/
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yubanmian/SuiteCRM.git
git@gitee.com:yubanmian/SuiteCRM.git
yubanmian
SuiteCRM
SuiteCRM
master

搜索帮助