Skip to content

Commit

Permalink
Merge pull request #4363 from cclauss/patch-2
Browse files Browse the repository at this point in the history
Travis CI: Add flake8 jobs on both Python 2.7 and 3.7
  • Loading branch information
amercader committed Jul 30, 2018
2 parents f1a24c2 + 6eda7c6 commit 4c46765
Showing 1 changed file with 53 additions and 19 deletions.
72 changes: 53 additions & 19 deletions .travis.yml
@@ -1,25 +1,59 @@
sudo: required

group: travis_latest
language: python

services:
- docker
matrix:
include:
- python: "2.7"
sudo: required

services:
- docker

cache:
directories:
- ~/docker

before_install:
- docker build --rm=false -f contrib/docker/postgresql/Dockerfile -t postgresql .
- docker build --rm=false -f contrib/docker/solr/Dockerfile -t solr .
- docker pull redis:latest
- docker build --rm=false -t ckan .

cache:
directories:
- ~/docker
install:
- docker run -d --name db postgresql
- docker run -d --name solr solr
- docker run -d --name redis redis:latest
- docker run -d --name ckan -p 5000:5000 --link db:db --link redis:redis --link solr:solr ckan

before_install:
- docker build --rm=false -f contrib/docker/postgresql/Dockerfile -t postgresql .
- docker build --rm=false -f contrib/docker/solr/Dockerfile -t solr .
- docker pull redis:latest
- docker build --rm=false -t ckan .
script:
- docker ps -a

install:
- docker run -d --name db postgresql
- docker run -d --name solr solr
- docker run -d --name redis redis:latest
- docker run -d --name ckan -p 5000:5000 --link db:db --link redis:redis --link solr:solr ckan
- python: "2.7"
env: FLAKE8=true
cache: pip
install:
- pip install flake8
before_script:
- flake8 --version
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
script:
- true

script:
- docker ps -a
- python: "3.7"
env: FLAKE8=true
dist: xenial # required for Python 3.7
sudo: required # required for Python 3.7
cache: pip
install:
- pip install flake8
before_script:
- flake8 --version
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
script:
- true

0 comments on commit 4c46765

Please sign in to comment.