Add test coverage check to CI
This commit is contained in:
Родитель
604d9b2134
Коммит
07dd52f6e4
|
@ -9,6 +9,7 @@ install:
|
|||
|
||||
script:
|
||||
- .travis/ci.sh
|
||||
- .travis/coverage.sh
|
||||
|
||||
after_success:
|
||||
- .travis/push.sh
|
|
@ -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
|
Загрузка…
Ссылка в новой задаче