From 40eceb448e8f7addb788e08b50ca3e92bd3effe9 Mon Sep 17 00:00:00 2001 From: cclauss Date: Tue, 14 May 2019 19:39:08 +0200 Subject: [PATCH] Use Travis CI to run tests on every pull request This is a second attempt at #1336 which got into a bad git-state... Use flake8 to find Python syntax errors and undefined names. There are Python 3 syntax errors and many undefined names which may raise NameError at runtime. This PR runs flake8 runs in two passes: The first looks at critical issues in stop-the-build mode and the second looks at style violations in everything-is-a-warning mode. --- .travis.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..b1041c104b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +dist:xenial +language: python +cache: pip +python: + - 2.7 + - 3.7 +matrix: + allow_failures: + - python: 3.7 +install: + #- pip install -r requirements.txt + - pip install flake8 # pytest # add another testing frameworks later +before_script: + # stop the build if there are Python syntax errors or undefined names + - flake8 . --count --select=E9,F63,F72,F82 --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 + - npm install +script: + - npm test + #- pytest --capture=sys # add other tests here +notifications: + on_success: change + on_failure: change # `always` will be the setting once code changes slow down