Ignore vendor/ for CI

This commit is contained in:
Julian Kornberger 2018-05-13 21:07:48 +02:00
parent f74e045273
commit bd398847ba
3 changed files with 6 additions and 3 deletions

View File

@ -12,7 +12,7 @@ echo "mode: count" > profile.cov
FAIL=0
# 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
if ls $dir/*.go &> /dev/null; then
go test -v -covermode=count -coverprofile=profile.tmp $dir || FAIL=$?
@ -33,6 +33,9 @@ fi
# Test if every package has testfiles
for dir in $(find . -name "*.go" -printf '%h\0'| sort -zu | sed -z 's/$/\n/');
do
# ignore ./vendor/ completely
[[ $dir == ./vendor/* ]] && continue
if [ "$(ls $dir/*_test.go 2> /dev/null | wc -l)" -eq "0" ]; then
echo -n "no test files for $dir";
case $dir in

View File

@ -1,6 +1,6 @@
#!/bin/bash
result="$(gofmt -s -l .)"
result="$(gofmt -s -l . | grep -v '^vendor/' )"
if [ -n "$result" ]; then
echo "Go code is not formatted, run 'gofmt -s -w .'" >&2
echo "$result"

View File

@ -11,5 +11,5 @@ install:
script:
- ./.test-coverage travis-ci
- ./.travis.gofmt.sh
- misspell -error .
- find . -type f -name '*.go' | grep -v '^./vendor/' | xargs misspell -error
- go install github.com/FreifunkBremen/yanic