Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Add CI check to ensure module definition is correct #198

Merged
merged 13 commits into from
Nov 29, 2019
21 changes: 21 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ variables:
#GO111MODULE: on

steps:

- bash: git config --global core.autocrlf false
displayName: "Disable line ending conversion for git to"

- checkout: self

- bash: |
latestGo=$(curl "https://golang.org/VERSION?m=text")
echo "##vso[task.setvariable variable=LATEST_GO]$latestGo"
Expand Down Expand Up @@ -78,6 +84,21 @@ steps:
env
displayName: Print Go version and environment

- bash: |
go mod tidy
if [ ! -z "$(git status --porcelain go.mod)" ]; then
printf "go.mod has modifications\n"
git diff go.mod
exit 1
fi
if [ ! -z "$(git status --porcelain go.sum)" ]; then
printf "go.sum has modifications\n"
git diff go.sum
exit 1
fi
workingDirectory: '$(modulePath)'
displayName: Ensure that module definition and checksums are correct

- script: |
go get -v -t -d ./...
golangci-lint run -E gofmt -E goimports -E misspell
Expand Down