diff --git a/.circleci/config.yml b/.circleci/config.yml index a252df7..98e2ab6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,6 @@ -version: 2 +version: 2.1 +orbs: + snyk: snyk/snyk@0.0.13 jobs: test_coco_assistant: working_directory: ~/project @@ -6,27 +8,39 @@ jobs: - image: circleci/python:3.6.6 steps: - checkout + # - restore_cache: + # key: coco-{{ .Branch }} + - run: + name: Setup environment + command: | + sudo chown -R circleci:circleci /usr/local/ + python -m pip install --upgrade pip + python -m pip install Cython numpy + python -m pip install -r requirements-dev.txt + # - save_cache: + # key: coco-{{ .Branch }} + # paths: + # - "/home/circleci/.cache/pip" + - snyk/scan - run: name: Runnning tests command: | - virtualenv venv - . venv/bin/activate - pip install --upgrade pip - pip install Cython numpy==1.16.0 - pip install -r requirements.txt - pip install pytest coverage codacy-coverage - make remove && make clean + make remove && sudo make clean + mkdir test-results + pytest --junitxml=test-results/junit.xml tests/tests.py coverage run tests/tests.py coverage report -m coverage html && coverage xml python-codacy-coverage -r coverage.xml + - store_test_results: + path: test-results - store_artifacts: path: coverage - - + + workflows: - version: 2 - test-all: + version: 2.1 + build_test: jobs: - test_coco_assistant: filters: @@ -34,6 +48,4 @@ workflows: only: - master - dev - - - + diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..e5132fd --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,20 @@ +# project requirements +Cython +matplotlib +numpy +pandas +Pillow>=8.1.1 +git+https://github.com/ashnair1/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI +seaborn +scikit-image +tqdm + +# packaging +setuptools>=40.6.3 +wheel>=0.32.3 + +# testing +requests +pytest +coverage +codacy-coverage \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 9493780..626d4f6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,5 +13,3 @@ tqdm setuptools>=40.6.3 wheel>=0.32.3 -# testing -requests