Skip to content

Commit

Permalink
build(go): Check if go.mod and go.sum are up to dated (#1377)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sayboras committed Sep 20, 2020
1 parent 5efb842 commit d4ebf99
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go.sum linguist-generated
15 changes: 15 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d4ebf99

Please sign in to comment.