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.)
This commit is contained in:
medmunds
2018-03-13 10:34:55 -07:00
committed by Mike Edmunds
parent 3874525fd0
commit b32c3ccb38

View File

@@ -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