tools: add prepare-source.sh
A script that runs various go tools (mod tidy, mod vendor, and fmt for now). The idea is that it prepares the source to be ready for master. As such, running it on master shouldn't modify any files. Make sure of that by adding a test.
This commit is contained in:
parent
6703055925
commit
049969911d
2 changed files with 17 additions and 0 deletions
10
.travis.yml
10
.travis.yml
|
|
@ -8,6 +8,16 @@ addons:
|
|||
- gnupg2
|
||||
matrix:
|
||||
include:
|
||||
- name: source-test
|
||||
script:
|
||||
- |
|
||||
set -e
|
||||
./tools/prepare-source.sh
|
||||
if [ ! $(git diff --quiet --exit-code) ]; then
|
||||
echo
|
||||
echo "Please include these changes in your branch: "
|
||||
git diff
|
||||
fi
|
||||
- name: unit-tests
|
||||
arch: amd64
|
||||
language: go
|
||||
|
|
|
|||
7
tools/prepare-source.sh
Executable file
7
tools/prepare-source.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
go fmt ./...
|
||||
go mod tidy
|
||||
go mod vendor
|
||||
Loading…
Add table
Add a link
Reference in a new issue