Skip to content

build: don't skip master build when only md files have changed #9879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions scripts/ci/travis-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@ cd $(dirname $0)/../..
source scripts/ci/sources/mode.sh
source scripts/ci/sources/tunnel.sh

# Get commit diff
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
fileDiff=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
else
# Get the commit diff and skip the build if only .md files have changed.
# Should not apply to master builds.
if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then
fileDiff=$(git diff --name-only $TRAVIS_BRANCH...HEAD)
fi

# Check if tests can be skipped
if [[ ${fileDiff} =~ ^(.*\.md\s*)*$ ]]; then
echo "Skipping tests since only markdown files changed."
exit 0
if [[ ${fileDiff} =~ ^(.*\.md\s*)*$ ]]; then
echo "Skipping tests because only markdown files changed."
exit 0
fi
fi

start_tunnel
Expand Down