Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move CI commands to travis build script
  • Loading branch information
REBELinBLUE committed Feb 18, 2017
1 parent e4e536c commit 21aff91
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 40 deletions.
44 changes: 38 additions & 6 deletions .travis.yml
Expand Up @@ -40,15 +40,31 @@ before_install:
- . $HOME/.nvm/nvm.sh
- nvm install stable
- nvm use stable
- if [[ "$TRAVIS_PHP_VERSION" != "7.1" ]]; then phpenv config-rm xdebug.ini; fi
- |
if [[ "$TRAVIS_PHP_VERSION" != "7.1" ]]; then
phpenv config-rm xdebug.ini;
fi
install:
- travis_retry composer install --no-interaction --prefer-dist --no-suggest
- travis_retry npm install --quiet

before_script:
- mkdir $TRAVIS_BUILD_DIR/tmp/
- make ci
- |
cp -f $TRAVIS_BUILD_DIR/tests/.env.travis $TRAVIS_BUILD_DIR/.env
if [[ "$DB" = "sqlite" ]]; then
sed -i "s/DB_CONNECTION=mysql/DB_CONNECTION=sqlite/g" .env
sed -i 's/DB_DATABASE=deployer//g' .env
sed -i 's/DB_USERNAME=travis//g' .env
touch $TRAVIS_BUILD_DIR/database/database.sqlite
elsif [[ "$DB" = "pgsql" ]]; then
sed -i "s/DB_CONNECTION=mysql/DB_CONNECTION=pgsql/g" .env
sed -i "s/DB_USERNAME=travis/DB_USERNAME=postgres/g" .env
psql -c 'CREATE DATABASE deployer;' -U postgres;
else
mysql -e 'CREATE DATABASE deployer;'
fi
- gulp
- make permissions

Expand All @@ -59,10 +75,26 @@ script:
- make rollback
- make phpcs
# - make phpmd
- if [[ "$TEST_SUITE" = "unit" ]]; then make phpunit-ci; fi
- if [[ "$TRAVIS_PHP_VERSION" = "7.1" ]]; then bash <(curl -s https://codecov.io/bash) -cF $TEST_SUITE; fi
- if [[ "$TEST_SUITE" = "integration" ]]; then make integration-ci; fi
- if [[ "$TRAVIS_PHP_VERSION" = "7.1" ]]; then bash <(curl -s https://codecov.io/bash) -cF $TEST_SUITE; fi
- |
if [[ "$TEST_SUITE" = "unit" ]]; then
if [[ "$TRAVIS_PHP_VERSION" = "7.1" ]]; then
echo "\033[32mUnit Tests with coverage\033[39m"
php vendor/bin/phpunit --coverage-clover coverage.xml --testsuite "Unit Tests"
bash <(curl -s https://codecov.io/bash) -cF $TEST_SUITE;
else
make phpunit
fi
fi
- |
if [[ "$TEST_SUITE" = "integration" ]]; then
if [[ "$TRAVIS_PHP_VERSION" = "7.1" ]]; then
echo "\033[32mIntegration tests with coverage\033[39m"
php vendor/bin/phpunit --coverage-clover coverage.xml --testsuite "Integration Tests"
bash <(curl -s https://codecov.io/bash) -cF $TEST_SUITE;
else
make integration;
fi
fi
- make phpdoc-check
- make phpcpd
- make lines
Expand Down
34 changes: 0 additions & 34 deletions Makefile
Expand Up @@ -129,40 +129,6 @@ update-deps: permissions
yarn upgrade
git add composer.lock yarn.lock

# Create the .env file for Travis CI
ci:
@cp -f $(TRAVIS_BUILD_DIR)/tests/.env.travis $(TRAVIS_BUILD_DIR)/.env
ifeq "$(DB)" "sqlite"
@sed -i "s/DB_CONNECTION=mysql/DB_CONNECTION=sqlite/g" .env
@sed -i 's/DB_DATABASE=deployer//g' .env
@sed -i 's/DB_USERNAME=travis//g' .env
@touch $(TRAVIS_BUILD_DIR)/database/database.sqlite
else ifeq "$(DB)" "pgsql"
@sed -i "s/DB_CONNECTION=mysql/DB_CONNECTION=pgsql/g" .env
@sed -i "s/DB_USERNAME=travis/DB_USERNAME=postgres/g" .env
@psql -c 'CREATE DATABASE deployer;' -U postgres;
else
@mysql -e 'CREATE DATABASE deployer;'
endif

# Run the PHPUnit unit tests for Travis CI
phpunit-ci:
ifeq "$(TRAVIS_PHP_VERSION)" "7.1"
@echo "\033[32mUnit Tests with coverage\033[39m"
@php vendor/bin/phpunit --coverage-clover coverage.xml --testsuite "Unit Tests"
else ifeq "$(DB)" "sqlite"
@$(MAKE) phpunit
endif

# Run the PHPUnit integration tests for Travis CI
integration-ci:
ifeq "$(TRAVIS_PHP_VERSION)" "7.1"
@echo "\033[32mIntegration tests with coverage\033[39m"
@php vendor/bin/phpunit --coverage-clover coverage.xml --testsuite "Integration Tests"
else ifeq "$(DB)" "sqlite"
@$(MAKE) integration
endif

# Create release
release: test
@/usr/local/bin/create-release
Expand Down

0 comments on commit 21aff91

Please sign in to comment.