This commit is contained in:
Clemens Wolff 2017-06-13 16:55:32 +02:00
Родитель 604d9b2134
Коммит 07dd52f6e4
2 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -9,6 +9,7 @@ install:
script:
- .travis/ci.sh
- .travis/coverage.sh
after_success:
- .travis/push.sh

12
.travis/coverage.sh Executable file
Просмотреть файл

@ -0,0 +1,12 @@
#!/usr/bin/env bash
min_coverage="${MIN_COVERAGE:-42}"
line_coverage="$(CI=true yarn coverage | grep '^All files *|' | cut -d'|' -f5 | tr -d ' ' | cut -d'.' -f1)"
if [ ${line_coverage} -lt ${min_coverage} ]; then
echo "Got test coverage of ${line_coverage} which is less than configured minimum of ${min_coverage}" >&2
exit 1
else
echo "Got test coverage of ${line_coverage}, well done" >&2
exit 0
fi