Skip to content

Commit

Permalink
adding circle config
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Aug 1, 2016
1 parent 42e8693 commit 7d80ee4
Showing 1 changed file with 111 additions and 0 deletions.
111 changes: 111 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
machine:
python:
version: 2.7.11
dependencies:
cache_directories:
- ~/lib
pre:
# requirements for package
- |
sudo apt-get install \
lftp \
libglpk-dev
- pip install -r requirements.txt

# requirements for testing and documentation
- |
mkdir -p ~/lib
if [ ! -f ~/lib/unitth/unitth.jar ]
then
mkdir -p ~/lib
wget http://downloads.sourceforge.net/project/junitth/unitth/unitth-1.3.1/unitth_1_3_1.zip \
-O ~/lib/unitth_1_3_1.zip
unzip ~/lib/unitth_1_3_1.zip -d ~/lib
fi
- pip install -r tests/requirements.txt
- pip install -r docs/requirements.txt
test:
pre:
# create folders for artifacts
- mkdir -p $CIRCLE_TEST_REPORTS/nose
- mkdir -p $CIRCLE_ARTIFACTS
override:
# run tests
- |
nosetests tests \
--with-xunit --xunit-file=$CIRCLE_TEST_REPORTS/nose.xml \
--with-coverage --cover-package=wc
post:
##### test reports
- mkdir -p tests/reports/nose
- mkdir -p tests/reports/unitth
- mkdir -p tests/reports/html
- cp $CIRCLE_TEST_REPORTS/nose.xml tests/reports/nose/$CIRCLE_BUILD_NUM.xml

#copy test history from lab server
- |
lftp sftp://karrlab_code:XMPJFSeG@code.karrlab.org \
-e "
mirror /home/karrlab_code/code.karrlab.org/$CIRCLE_PROJECT_REPONAME/tests/nose tests/reports/nose;
bye;
"
# generate test reports that are readable UnitTH
- |
for report_path in tests/reports/nose/*.xml
do
report_base_name=${report_path##*/}
report_file_name=${report_base_name%.xml}
nose2unitth tests/reports/nose/$report_base_name tests/reports/unitth/$report_file_name/
junit2html tests/reports/nose/$report_base_name tests/reports/unitth/$report_file_name/index.html
done
# generate report of test history
- |
java \
-Dunitth.generate.exectimegraphs=true \
-Dunitth.xml.report.filter= \
-Dunitth.html.report.path=. \
-Dunitth.report.dir=tests/reports/html \
-jar ~/lib/unitth/unitth.jar tests/reports/unitth/*
#copy test history to lab server
- |
lftp sftp://karrlab_code:XMPJFSeG@code.karrlab.org \
-e "
put -O /home/karrlab_code/code.karrlab.org/$CIRCLE_PROJECT_REPONAME/tests/nose tests/reports/nose/$CIRCLE_BUILD_NUM.xml;
mirror -e -R tests/reports/unitth/$CIRCLE_BUILD_NUM /home/karrlab_code/code.karrlab.org/$CIRCLE_PROJECT_REPONAME/tests/unitth/$CIRCLE_BUILD_NUM;
mirror -e -R tests/reports/html /home/karrlab_code/code.karrlab.org/$CIRCLE_PROJECT_REPONAME/tests/html;
bye;
"
##### coverage
# copy coverage report to artifacts directory
- cp .coverage $CIRCLE_ARTIFACTS

# post coverage report to coveralls
- coveralls

# post covergage report to lab server
- coverage html -d tests/reports/coverage
- |
lftp sftp://karrlab_code:XMPJFSeG@code.karrlab.org \
-e "
mirror -R tests/reports/coverage /home/karrlab_code/code.karrlab.org/$CIRCLE_PROJECT_REPONAME/tests/coverage;
bye;
"
##### documentation
# generate documentation
- mkdir -p docs/static
- sphinx-apidoc -f -o docs/source/ wc
- make -C docs/ html

# copy documentation to lab server
- |
lftp sftp://karrlab_code:XMPJFSeG@code.karrlab.org \
-e "
mirror -R docs/build/html /home/karrlab_code/code.karrlab.org/$CIRCLE_PROJECT_REPONAME/docs;
bye;
"

0 comments on commit 7d80ee4

Please sign in to comment.