Skip to content

Commit 377b54d

Browse files
authored
Add check for go mod tidy in CI (#601)
*Issue #, if available:* N/A *Description of changes:* Adds module tidy check to CI, to prevent changes introducing issues. We should be able to avoid PRs being needed in the future to rectify, like this one: #599 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com>
1 parent 34a23a6 commit 377b54d

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/unit-tests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
- name: Check style
2323
run: make check_style
2424

25+
- name: Check module tidy
26+
run: make check_mod_tidy
27+
2528
- name: Check licenses
2629
run: make check_licenses
2730

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ e2e: e2e-controller
176176
check_style:
177177
test -z "$$(gofmt -d . | tee /dev/stderr)"
178178

179+
.PHONY: check_tidy
180+
check_mod_tidy:
181+
test -z "$$(go mod tidy --diff | tee /dev/stderr)"
182+
179183
.PHONY: check_licenses
180184
check_licenses: download_go_deps
181185
go tool github.com/google/go-licenses/v2 check --allowed_licenses ${ALLOWED_LICENSES} ./...

0 commit comments

Comments
 (0)