-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rework: exhaustive, deadcode and gomod check
- Loading branch information
1 parent
8550d6d
commit d4e2c41
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,26 @@ jobs: | |
with: | ||
version: v1.58 | ||
args: --timeout=5m | ||
|
||
- name: ./gomod.sh | ||
run: ./gomod.sh | ||
|
||
- name: exhaustive github.com/nishanths/[email protected] | ||
run: | | ||
go install github.com/nishanths/exhaustive/cmd/[email protected] | ||
exhaustive -default-signifies-exhaustive ./... | ||
- name: deadcode golang.org/x/tools/cmd/[email protected] | ||
run: | | ||
go install golang.org/x/tools/cmd/[email protected] | ||
output=$(deadcode -test ./...) | ||
if [[ -n "$output" ]]; then | ||
echo "🚨 Deadcode found:" | ||
echo "$output" | ||
exit 1 | ||
else | ||
echo "✅ No deadcode found" | ||
fi | ||
build: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#! /bin/bash | ||
set -e | ||
|
||
go mod tidy | ||
git diff --exit-code -- go.mod || (echo "Go file go.mod is dirty, update the file with 'go mod tidy' locally." && exit 1) | ||
git diff --exit-code -- go.sum || (echo "Go file go.sum is dirty, update the file with 'go mod tidy' locally." && exit 1) | ||
diff -u go.list <(go list -m all) || (echo "Go dependencies have changed, update the go.list file with 'go list -m all > go.list' locally." && exit 1) | ||
go mod verify || (echo "One or more Go dependencies failed verification. Either a version is no longer available, or the author or someone else has modified the version so it no longer points to the same code." && exit 1) |