Do not run tests if not needed

This commit is contained in:
Kamil Kokot 2018-08-29 12:30:13 +02:00
parent 43666e7f47
commit eb86d91ca0
No known key found for this signature in database
GPG key ID: 7BD76F7054D93C89
5 changed files with 4 additions and 4 deletions

View file

@ -6,7 +6,7 @@ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
exit 0 # Always execute full suite on branch builds
fi
if [ $(git diff --name-only HEAD origin/master | grep -c -v -e ^docs -e ^CHANGELOG.md -e ^CONTRIBUTING.md -e ^LICENSE -e ^PULL_REQUEST_TEMPLATE.md -e ^README.md -e ^UPGRADE.md) -eq 0 ]; then
if [ $(git diff --name-only HEAD origin/$TRAVIS_BRANCH | grep -c -v -e ^docs -e ^.github -e ^CHANGELOG -e ^LICENSE -e ^README -e ^UPGRADE) -eq 0 ]; then
print_header "Skipped suite" "Application"
print_warning "No other changes than those in docs/* were found"
exit 1

View file

@ -3,7 +3,7 @@
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"
print_header "Customizing the environment" "Sylius"
run_command "git fetch origin master:refs/remotes/origin/master" || exit $? # Make origin/master available for is_suitable steps
run_command "git fetch origin $TRAVIS_BRANCH:refs/remotes/origin/$TRAVIS_BRANCH" || exit $? # Make origin/master available for is_suitable steps
run_command "phpenv config-rm xdebug.ini" # Disable XDebug
run_command "echo \"memory_limit=4096M\" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini" || exit $? # Increase memory limit to 4GB
run_command "mkdir -p \"${SYLIUS_CACHE_DIR}\"" || exit $? # Create Sylius cache directory

View file

@ -6,7 +6,7 @@ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
exit 0 # Always execute full suite on branch builds
fi
if [ $(git diff --name-only HEAD origin/master | grep -c -e ^docs) -eq 0 ]; then
if [ $(git diff --name-only HEAD origin/$TRAVIS_BRANCH | grep -c -e ^docs) -eq 0 ]; then
print_header "Skipped suite" "Docs"
print_warning "No changes detected in docs/*"
exit 1

View file

@ -6,7 +6,7 @@ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
exit 0 # Always execute full suite on branch builds
fi
if [ $(git diff --name-only HEAD origin/master | grep -c -e ^src/Sylius/Bundle -e ^src/Sylius/Component) -eq 0 ]; then
if [ $(git diff --name-only HEAD origin/$TRAVIS_BRANCH | grep -c -e ^src/Sylius/Bundle -e ^src/Sylius/Component) -eq 0 ]; then
print_header "Skipped suite" "Packages"
print_warning "No changes detected in src/Sylius/Bundle/* or src/Sylius/Component/*"
exit 1