diff --git a/.travis.yml b/.travis.yml index 7567b07f6aa..ff7da202ecb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,23 +42,23 @@ before_install: install: - source scripts/install-${TRAVIS_OS_NAME} # OS-specific installs - - pip install pyyaml coveralls - - make -C api install - - make -C app install + - make install script: - "export OT_TIME_SUFFIX=-$(date '+%Y-%m-%d_%H-%M')" - "export OT_BRANCH_SUFFIX=-${TRAVIS_BRANCH}" - "export OT_COMMIT_SUFFIX=-${TRAVIS_COMMIT:0:7}" + # TODO(mc, 2018-08-28): use top level `make test` - make -C api test exe - > # Make docs on linux only if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then (make -C api docs > /dev/null) fi; + # TODO(mc, 2018-08-28): use top level `make test` - make -C app -j 2 build test && make -C app package # Clean up. This will leave only single-file build artifacts - find ./app/dist/** ! -name 'opentrons-v*' -exec rm -rf {} + after_success: - - cd api && coveralls && cd .. + - make coverage # Deploy the build version in an S3 bucket deploy: @@ -78,7 +78,7 @@ deploy: # Publish API to PyPI and Anaconda - provider: script skip_cleanup: true - script: cd api && make publish && cd .. + script: make -C api publish on: tags: true diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..aae5e7a0283 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +# opentrons platform makefile +# https://github.com/OpenTrons/opentrons + +SHELL := /bin/bash + +API_DIR := api +APP_DIR := app + +.PHONY: install test coverage + +# install project dependencies for both api and app +install: + $(MAKE) -C $(API_DIR) install + $(MAKE) -C $(APP_DIR) install + +# run api and app tests +test: + $(MAKE) -C $(API_DIR) test + $(MAKE) -C $(APP_DIR) test + +# upload coverage reports +# uses codecov's bash upload script +# TODO(mc, 2018-08-28): add test as a task dependency once travis is setup to +# use this Makefile for tests +coverage: + $(SHELL) <(curl -s https://codecov.io/bash) -X coveragepy diff --git a/README.md b/README.md index 443d5b2d95c..1c366d3f636 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Opentrons Platform +[![Travis CI][travis-badge]][travis] +[![Codecov][codecov-badge]][codecov] + * [Overview](#overview) * [Opentrons API](#api) * [OT-App](#app) @@ -134,3 +137,8 @@ make dev ``` Enjoy! + +[travis]: https://travis-ci.org/OpenTrons/opentrons/branches +[travis-badge]: https://img.shields.io/travis/OpenTrons/opentrons/app-3-0.svg?style=flat-square&maxAge=3600 +[codecov]: https://codecov.io/gh/OpenTrons/opentrons/branches +[codecov-badge]: https://img.shields.io/codecov/c/github/OpenTrons/opentrons/app-3-0.svg?style=flat-square&maxAge=3600 diff --git a/api/.coveragerc b/api/.coveragerc index ee97006cee0..d1ba6fee10a 100644 --- a/api/.coveragerc +++ b/api/.coveragerc @@ -5,5 +5,5 @@ omit = */lib_pypy/_*.py */site-packages/ordereddict.py */site-packages/nose/* - */unittest2/* - opentrons/_version.py \ No newline at end of file + */tests/* + opentrons/_version.py diff --git a/api/Makefile b/api/Makefile index 326ec7cca5a..4fb92912e64 100644 --- a/api/Makefile +++ b/api/Makefile @@ -1,4 +1,6 @@ -SHELL:=/bin/bash +# opentrons api makefile + +SHELL := /bin/bash .PHONY: test docs publish clean install exe dev @@ -6,7 +8,7 @@ install: python setup.py install && pip install -r requirements.txt test: - pylama opentrons tests && py.test --cov + pylama opentrons tests && py.test --cov && coverage xml docs: cd docs && make html && make doctest diff --git a/app/Makefile b/app/Makefile index 286a67ccea5..08bd8a5fe9e 100644 --- a/app/Makefile +++ b/app/Makefile @@ -1,4 +1,4 @@ -# app makefile +# opentrons app makefile # use bash SHELL := /bin/bash diff --git a/app/package.json b/app/package.json index 23239382690..07d288d0b9f 100644 --- a/app/package.json +++ b/app/package.json @@ -110,6 +110,9 @@ "!webpack**", "!coverage/**", "!**/test/**" + ], + "coverageReporters": [ + "lcov", "text" ] }, "standard": {