Ignore vendor/ for CI
This commit is contained in:
parent
f74e045273
commit
bd398847ba
|
@ -12,7 +12,7 @@ echo "mode: count" > profile.cov
|
||||||
FAIL=0
|
FAIL=0
|
||||||
|
|
||||||
# Standard go tooling behavior is to ignore dirs with leading underscors
|
# Standard go tooling behavior is to ignore dirs with leading underscors
|
||||||
for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d);
|
for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d | grep -v '^./vendor/');
|
||||||
do
|
do
|
||||||
if ls $dir/*.go &> /dev/null; then
|
if ls $dir/*.go &> /dev/null; then
|
||||||
go test -v -covermode=count -coverprofile=profile.tmp $dir || FAIL=$?
|
go test -v -covermode=count -coverprofile=profile.tmp $dir || FAIL=$?
|
||||||
|
@ -33,6 +33,9 @@ fi
|
||||||
# Test if every package has testfiles
|
# Test if every package has testfiles
|
||||||
for dir in $(find . -name "*.go" -printf '%h\0'| sort -zu | sed -z 's/$/\n/');
|
for dir in $(find . -name "*.go" -printf '%h\0'| sort -zu | sed -z 's/$/\n/');
|
||||||
do
|
do
|
||||||
|
# ignore ./vendor/ completely
|
||||||
|
[[ $dir == ./vendor/* ]] && continue
|
||||||
|
|
||||||
if [ "$(ls $dir/*_test.go 2> /dev/null | wc -l)" -eq "0" ]; then
|
if [ "$(ls $dir/*_test.go 2> /dev/null | wc -l)" -eq "0" ]; then
|
||||||
echo -n "no test files for $dir";
|
echo -n "no test files for $dir";
|
||||||
case $dir in
|
case $dir in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
result="$(gofmt -s -l .)"
|
result="$(gofmt -s -l . | grep -v '^vendor/' )"
|
||||||
if [ -n "$result" ]; then
|
if [ -n "$result" ]; then
|
||||||
echo "Go code is not formatted, run 'gofmt -s -w .'" >&2
|
echo "Go code is not formatted, run 'gofmt -s -w .'" >&2
|
||||||
echo "$result"
|
echo "$result"
|
||||||
|
|
|
@ -11,5 +11,5 @@ install:
|
||||||
script:
|
script:
|
||||||
- ./.test-coverage travis-ci
|
- ./.test-coverage travis-ci
|
||||||
- ./.travis.gofmt.sh
|
- ./.travis.gofmt.sh
|
||||||
- misspell -error .
|
- find . -type f -name '*.go' | grep -v '^./vendor/' | xargs misspell -error
|
||||||
- go install github.com/FreifunkBremen/yanic
|
- go install github.com/FreifunkBremen/yanic
|
||||||
|
|
Loading…
Reference in New Issue