Check more stuff in CI
This commit is contained in:
parent
a8e4c6bc8b
commit
7d00bc0452
@ -1,4 +1,3 @@
|
||||
test:
|
||||
script:
|
||||
- go vet -v ./...
|
||||
- go test -v ./...
|
||||
- ./ci_check
|
||||
|
26
ci_check
Executable file
26
ci_check
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
old_dir=$PWD
|
||||
new_dir=`mktemp -d`
|
||||
|
||||
cleanup() {
|
||||
rm -rf "$new_dir"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
cp -r . "$new_dir"
|
||||
cd "$new_dir"
|
||||
|
||||
checkgen() {
|
||||
$1
|
||||
if ! diff -r . "$old_dir"
|
||||
then
|
||||
echo $2 1>&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
checkgen 'go generate ./...' 'Generated files not up-to-date. Please run go generate.'
|
||||
checkgen 'go fmt ./...' '.go files not formatted. Please run go fmt.'
|
||||
go vet ./...
|
||||
go test ./...
|
Loading…
Reference in New Issue
Block a user