Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit d74b935

Browse files
committed
ci: adds check to ensure go modules are up to date
1 parent 9fa652d commit d74b935

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ script:
1212
- go install github.com/golang/mock/mockgen
1313
- ./ci/check_go_fmt.sh
1414
- ./ci/check_go_generate.sh
15+
- ./ci/check_go_mod.sh
1516
- go test -v ./...

ci/check_go_mod.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# This script is used to ensure that the go.mod file is up to date.
3+
4+
set -euo pipefail
5+
6+
go mod tidy
7+
8+
if [ ! -z "$(git status --porcelain)" ]; then
9+
git status
10+
echo
11+
echo "The go.mod is not up to date."
12+
exit 1
13+
fi

0 commit comments

Comments
 (0)