Skip to content

Commit d2ff798

Browse files
Mark-Simulacrumtomprince
authored andcommitted
Don't run travis tests on master.
This saves us builders for more helpful purposes.
1 parent abb50f2 commit d2ff798

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

.travis.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,30 @@ before_script:
152152
echo "#### Disk usage before running script:";
153153
df -h;
154154
du . | sort -nr | head -n100
155+
# If we are building a pull request, do the build if $ALLOW_PR == 1
156+
# Otherwise, do the build if we are on the auto branch, or the try branch and $ALLOW_TRY == 1
155157
- >
156-
if [[ "$ALLOW_PR" = "1" || "$TRAVIS_BRANCH" == "auto" || ( "$ALLOW_TRY" = "1" && "$TRAVIS_BRANCH" = "try" ) ]]; then
158+
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
159+
if [[ "$ALLOW_PR" == "1" ]]; then
160+
SKIP_BUILD=false;
161+
else
162+
SKIP_BUILD=true;
163+
fi
164+
elif [[ "$TRAVIS_BRANCH" == "auto" || ( "$ALLOW_TRY" == "1" && "$TRAVIS_BRANCH" == "try" ) ]]; then
165+
SKIP_BUILD=false;
166+
else
167+
SKIP_BUILD=true;
168+
fi
169+
170+
if [[ "$SKIP_BUILD" == true ]]; then
171+
export RUN_SCRIPT="echo 'skipping, not a full build'";
172+
else
157173
RUN_SCRIPT="stamp src/ci/init_repo.sh . $HOME/rustsrc";
158174
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
159175
export RUN_SCRIPT="$RUN_SCRIPT && stamp src/ci/run.sh";
160176
else
161177
export RUN_SCRIPT="$RUN_SCRIPT && stamp src/ci/docker/run.sh $IMAGE";
162178
fi
163-
else
164-
export RUN_SCRIPT="echo 'skipping, not a full build'";
165179
fi
166180
167181
script:

0 commit comments

Comments
 (0)