From b32c3ccb38ec8f7be7de5c3f74e266bdb5ac9c8a Mon Sep 17 00:00:00 2001 From: medmunds Date: Tue, 13 Mar 2018 10:34:55 -0700 Subject: [PATCH] Travis: only run on release branches Avoid running Travis builds twice for PRs (once for the feature branch and once for the PR). (Also simplify Travis pip cache using newer directive.) --- .travis.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81d676c..f3dffe3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,14 @@ sudo: false language: python +branches: + # Only run builds on release branches. + # (Builds will *also* still run on pull requests; + # this avoids duplicate builds on the PR *branches*, too.) + only: + - master + - /^v\d+\.\d+(\.\d+)?(-\S*)?$/ + matrix: include: # Anymail supports the same python versions as Django, excluding Python 3.2, but adding pypy. @@ -45,9 +53,7 @@ matrix: # - env: DJANGO="--pre django" # - python: 3.6 -cache: - directories: - - $HOME/.cache/pip +cache: pip # If env DJANGO is set, install Anymail and run tests # If env FLAKE8 is set, run flake8