Skip to content

Commit

Permalink
Switch to CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
abagshaw committed Feb 26, 2018
1 parent ddf5c62 commit 04ad652
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
42 changes: 42 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6.1

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "test/requirements-testing.txt" }}

- run:
name: install dependencies
command: |
pip install -r test/requirements-testing.txt
- run:
name: install darkflow
command: |
pip install -e .
- save_cache:
paths:
- ./bin #Cache .weight files
key: v1-dependencies-{{ checksum "test/requirements-testing.txt" }}

# run tests!
- run:
name: run tests
command: |
pytest -x --cov=./
python manage.py test
- run:
name: upload coverage results
command: |
codecov
8 changes: 4 additions & 4 deletions test/test_darkflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
import sys
import pytest

#NOTE: This file is designed to be run in the TravisCI environment. If you want to run it locally set the environment variable TRAVIS_BUILD_DIR to the base
#NOTE: This file is designed to be run in the CircleCI environment. If you want to run it locally set the environment variable CIRCLE_WORKING_DIRECTORY to the base
# directory of the cloned darkflow repository. WARNING: This file delete images from sample_img/ that won't be used for testing (so don't run it
# locally if you don't want this happening!)

#Settings
buildPath = os.environ.get("TRAVIS_BUILD_DIR")
buildPath = os.environ.get("CIRCLE_WORKING_DIRECTORY")

if buildPath is None:
print()
print("TRAVIS_BUILD_DIR environment variable was not found - is this running on TravisCI?")
print("If you want to test this locally, set TRAVIS_BUILD_DIR to the base directory of the cloned darkflow repository.")
print("CIRCLE_WORKING_DIRECTORY environment variable was not found - is this running on CircleCI?")
print("If you want to test this locally, set CIRCLE_WORKING_DIRECTORY to the base directory of the cloned darkflow repository.")
exit()

testImg = {"path": os.path.join(buildPath, "sample_img", "sample_person.jpg"), "width": 640, "height": 424,
Expand Down

0 comments on commit 04ad652

Please sign in to comment.