verify go.mod & go.sum consistency in CI (#136)
Signed-off-by: GautamBytes <manchandanigautam@gmail.com>
This commit is contained in:
parent
94742398cd
commit
d973c2aa1d
|
|
@ -27,6 +27,14 @@ jobs:
|
||||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
- name: Verify go.mod is tidy
|
||||||
|
run: |
|
||||||
|
go mod tidy
|
||||||
|
if [ -n "$(git status --porcelain go.mod go.sum)" ]; then
|
||||||
|
echo "go.mod or go.sum is not tidy"
|
||||||
|
git diff go.mod go.sum
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
- name: Cache Go Dependencies
|
- name: Cache Go Dependencies
|
||||||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
||||||
with:
|
with:
|
||||||
|
|
@ -51,6 +59,14 @@ jobs:
|
||||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
- name: Verify go.mod is tidy
|
||||||
|
run: |
|
||||||
|
go mod tidy
|
||||||
|
if [ -n "$(git status --porcelain go.mod go.sum)" ]; then
|
||||||
|
echo "go.mod or go.sum is not tidy"
|
||||||
|
git diff go.mod go.sum
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
make build
|
make build
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue