chiark / gitweb /
package/ci: upload code coverage to codecov.io.
authorVladimír Vondruš <mosra@centrum.cz>
Sat, 27 Jan 2018 17:46:57 +0000 (18:46 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 27 Jan 2018 18:46:22 +0000 (19:46 +0100)
package/ci/travis.yml

index efcfe935acae9782d08488d97013e37d1540ac70..7061591b38c4247cafe869203be13fa164e22fb4 100644 (file)
@@ -19,7 +19,7 @@ matrix:
 install:
   # 2.10 has some weird behavior, putting a lot of empty lines into the output
   - pip install jinja2==2.9.6
-  - pip install pelican Pyphen Pillow
+  - pip install pelican Pyphen Pillow coverage codecov
 
   # Needed for doxygen binaries
   - mkdir -p $HOME/bin && export PATH=$HOME/bin:$PATH
@@ -29,14 +29,14 @@ install:
 
 script:
   # Test the theme
-  - cd $TRAVIS_BUILD_DIR/pelican-theme && python -m unittest
+  - cd $TRAVIS_BUILD_DIR/pelican-theme && coverage run -m unittest && cp .coverage ../.coverage.theme
 
   # Test plugins. Math plugin is not tested as dvisvgm on 14.04 is unusable.
-  - cd $TRAVIS_BUILD_DIR/pelican-plugins && python -m unittest
+  - cd $TRAVIS_BUILD_DIR/pelican-plugins && coverage run -m unittest && cp .coverage ../.coverage.plugins
 
   # Test doxygen theme. Math rendering is not tested as dvisvgm on 14.04 is
   # unusable.
-  - if [ "$WITH_DOXYGEN" == "ON" ]; then cd $TRAVIS_BUILD_DIR/doxygen && python -m unittest; fi
+  - if [ "$WITH_DOXYGEN" == "ON" ]; then cd $TRAVIS_BUILD_DIR/doxygen && coverage run -m unittest && cp .coverage ../.coverage.doxygen; fi
 
 # Cache the downloaded doxygen
 cache:
@@ -50,3 +50,6 @@ notifications:
     on_success: change
     on_failure: always
     on_start: never
+
+after_success:
+  - cd $TRAVIS_BUILD_DIR && coverage combine && codecov