Skip to content

Commit 44e1f77

Browse files
committed
Validate go mod on CI
1 parent a3fcd67 commit 44e1f77

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ubuntu-latest, windows-latest, macos-latest]
11+
1112
steps:
1213
- name: Install Go
1314
uses: actions/setup-go@v1
@@ -36,16 +37,33 @@ jobs:
3637
run: |
3738
make test
3839
39-
lint:
40-
name: Lint
40+
checks:
41+
name: Checks
4142
runs-on: ubuntu-latest
4243
steps:
4344
- name: Install Go
4445
uses: actions/setup-go@v1
4546
with:
4647
go-version: 1.12
48+
4749
- name: Checkout
4850
uses: actions/checkout@v1
51+
52+
- name: Go mod
53+
env:
54+
DIFF_PATH: "go.mod go.sum"
55+
run: |
56+
go mod tidy
57+
DIFF=$(git status --porcelain -- $DIFF_PATH)
58+
if [ "$DIFF" ]; then
59+
echo
60+
echo "These files were modified:"
61+
echo
62+
echo "$DIFF"
63+
echo
64+
exit 1
65+
fi
66+
4967
- name: Lint
5068
run: |
5169
make lint

0 commit comments

Comments
 (0)