Skip to content

Commit

Permalink
Add Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rht committed Jun 23, 2017
1 parent 94e61b0 commit 2fe37d9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: python
sudo: false

cache:
pip: true

os:
- linux

python:
- 2.7
- 3.5

install:
# - pip install coveralls flake8
- pip install -r requirements.txt

script:
# TODO to be enabled later
#- flake8 . --ignore=F403,E501,E123,E128 --exclude=build
- python start.py --travis
17 changes: 14 additions & 3 deletions start.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from collections import defaultdict

import math
import argparse
#import pdb

simulation_parameters = {'name': 'name',
Expand All @@ -21,7 +22,7 @@
'start_cash_customer': 100000.0}

#@gui(simulation_parameters)
def main(simulation_parameters):
def main(simulation_parameters, isTravis):
simulation = Simulation(rounds=simulation_parameters['scheduledEndTime'], processes=1)

insurancefirms = simulation.build_agents(InsuranceFirm, 'insurancefirm',
Expand Down Expand Up @@ -55,7 +56,17 @@ def main(simulation_parameters):
allagents.do('filobl')
insurancecustomers.do('check_risk')

simulation.graphs()
if not isTravis:
simulation.graphs()


if __name__ == '__main__':
main(simulation_parameters)
# <Travis-specific code>
parser = argparse.ArgumentParser()
parser.add_argument('--travis', dest='travis', action='store_true',
default=False,
help='Flag to disable gui when run in a Travis environment')
args = parser.parse_args()
# </Travis-specific code>

main(simulation_parameters, args.travis)

0 comments on commit 2fe37d9

Please sign in to comment.