Skip to content

Commit

Permalink
Enhance workFlow to add git mod tidy (#458)
Browse files Browse the repository at this point in the history
Signed-off-by: kruthika04 <[email protected]>
  • Loading branch information
kruthika04 authored Sep 22, 2023
1 parent 5a105f0 commit e16e035
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-on-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ jobs:
version: ${{ env.GOLANGCILINT_VER }}
skip-cache: true
args: --timeout=10m0s

- name: Run go mod tidy check diff
run: make modtidy check-diff
2 changes: 2 additions & 0 deletions .github/workflows/validate_examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install mechanical-markdown
- name: Run go mod tidy check diff
run: make modtidy check-diff
- name: Set up Dapr CLI
run: wget -q ${{ env.DAPR_INSTALL_URL }} -O - | /bin/bash -s ${{ env.DAPR_CLI_VER }}
- name: Set up Go ${{ env.GOVER }}
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,12 @@ clean: ## Cleans go and generated files in ./dapr/proto/
help: ## Display available commands
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk \
'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: check-diff
check-diff:
git diff --exit-code ./go.mod # check no changes
git diff --exit-code ./go.sum # check no changes

.PHONY: modtidy
modtidy:
go mod tidy

0 comments on commit e16e035

Please sign in to comment.