File tree 3 files changed +20
-0
lines changed
3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 21
21
PKG_CONFIG_PATH : /home/linuxbrew/.linuxbrew/Cellar/libgit2/1.1.1/lib/pkgconfig/
22
22
GITCONVEX_TEST_REPO : /home/runner/work/gitconvex-server/gitconvex-test
23
23
GITCONVEX_DEFAULT_PATH : /usr/local/gitconvex
24
+ COVERAGE_THRESHOLD : 90
24
25
25
26
steps :
26
27
- name : Install libgit2 from Homebrew
51
52
export PATH=$PATH:$(go env GOPATH)/bin
52
53
make test-ci-pretty
53
54
55
+ - name : Check Coverage
56
+ shell : bash
57
+ run : |
58
+ export COVERAGE_PERCENT=`go tool cover -func=coverage.out | grep "total:" | grep -Eo '[0-9]+\.[0-9]+'`
59
+ echo "Current coverage percentage : $COVERAGE_PERCENT"
60
+ make check-coverage
61
+
62
+
54
63
gitconvex-build :
55
64
needs :
56
65
- gitconvex-test
Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ dockerise-test:
72
72
docker-compose -f docker-compose.test.yaml build && \
73
73
docker-compose -f docker-compose.test.yaml up
74
74
75
+ check-coverage :
76
+ sh ./build_scripts/check_coverage.sh
77
+
75
78
show-coverage :
76
79
go tool cover -html=coverage.out
77
80
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [[ $COVERAGE_PERCENT < $COVERAGE_THRESHOLD ]];
4
+ then
5
+ echo " Coverage $COVERAGE_PERCENT is less that the threshold $COVERAGE_THRESHOLD " && exit 1;
6
+ else
7
+ echo " ✔️ Good work! Coverage $COVERAGE_PERCENT meets the expectation"
8
+ fi ;
You can’t perform that action at this time.
0 commit comments