build(go): Check if go.mod and go.sum are up to dated (#1377)
This commit is to add job to check if go.mod and go.sum are up to date. Also add go.sum into .gitattributes so that it will be considered as generated file in PR review. Signed-off-by: Tam Mach <sayboras@yahoo.com>
This commit is contained in:
parent
5efb842164
commit
d4ebf99e5e
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
go.sum linguist-generated
|
15
.github/workflows/pr.yml
vendored
15
.github/workflows/pr.yml
vendored
@ -8,6 +8,21 @@ on:
|
||||
- master
|
||||
pull_request:
|
||||
jobs:
|
||||
# Check if there any dirty change for go mod tidy
|
||||
go-mod:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.15
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Check go mod
|
||||
run: |
|
||||
go mod tidy
|
||||
git diff --exit-code
|
||||
|
||||
# We already run the current golangci-lint in tests, but here we test
|
||||
# our GitHub action with the latest stable golangci-lint.
|
||||
golangci-lint:
|
||||
|
Loading…
x
Reference in New Issue
Block a user