config.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # Python CircleCI 2.0 configuration file
  2. #
  3. # Check https://circleci.com/docs/2.0/language-python/ for more details
  4. #
  5. version: 2
  6. workflows:
  7. version: 2
  8. test:
  9. jobs:
  10. - test-3.6
  11. - test-2.7
  12. jobs:
  13. test-3.6:
  14. docker:
  15. - image: circleci/python:3.6.1
  16. environment:
  17. - NEO_TEST_FILE_DIR: "/home/circleci/repo/files_for_testing_neo"
  18. working_directory: ~/repo
  19. steps:
  20. - checkout
  21. # Download and cache dependencies
  22. - restore_cache:
  23. keys:
  24. - v1-dependencies-{{ checksum "requirements.txt" }}
  25. # fallback to using the latest cache if no exact match is found
  26. - v1-dependencies-
  27. - restore-cache:
  28. keys:
  29. - test-files-f7905c85d1
  30. - run:
  31. name: install dependencies
  32. command: |
  33. python3 -m venv venv
  34. . venv/bin/activate
  35. pip install -r requirements.txt
  36. pip install -r .circleci/requirements_testing.txt
  37. pip install .
  38. - save_cache:
  39. paths:
  40. - ./venv
  41. key: v1-dependencies-{{ checksum "requirements.txt" }}
  42. - save_cache:
  43. paths:
  44. - ./files_for_testing_neo
  45. key: test-files-f7905c85d1
  46. # run tests!
  47. - run:
  48. name: run tests
  49. command: |
  50. . venv/bin/activate
  51. nosetests -v --with-coverage --cover-package=neo
  52. - run:
  53. name: coveralls
  54. command: |
  55. . venv/bin/activate
  56. coveralls || true # a coveralls failure shouldn't cause a build failure
  57. - store_artifacts:
  58. path: test-reports
  59. destination: test-reports
  60. test-2.7:
  61. docker:
  62. - image: circleci/python:2.7-stretch
  63. environment:
  64. - NEO_TEST_FILE_DIR: "/home/circleci/repo/files_for_testing_neo"
  65. working_directory: ~/repo
  66. steps:
  67. - checkout
  68. # Download and cache dependencies
  69. - restore_cache:
  70. keys:
  71. - v1-py2-dependencies-{{ checksum "requirements.txt" }}
  72. # fallback to using the latest cache if no exact match is found
  73. - v1-py2-dependencies-
  74. - restore-cache:
  75. keys:
  76. - test-files-f7905c85d1
  77. - run:
  78. name: install dependencies
  79. command: |
  80. virtualenv venv2
  81. . venv2/bin/activate
  82. pip install -r requirements.txt
  83. pip install -r .circleci/requirements_testing.txt
  84. pip install mock # only needed for Python 2
  85. pip install .
  86. - save_cache:
  87. paths:
  88. - ./venv2
  89. key: v1-py2-dependencies-{{ checksum "requirements.txt" }}
  90. - save_cache:
  91. paths:
  92. - ./files_for_testing_neo
  93. key: test-files-f7905c85d1
  94. # run tests!
  95. - run:
  96. name: run tests
  97. command: |
  98. . venv2/bin/activate
  99. nosetests -v --with-coverage --cover-package=neo
  100. - store_artifacts:
  101. path: test-reports
  102. destination: test-reports