Skip to content

Commit

Permalink
ci: add test for uncommitted changes in deploy directory
Browse files Browse the repository at this point in the history
added test for uncommitted changes in deploy directory under go-test GH action.
Also, created a new make target named `make check-deploy-committed` that
can be used to verify the uncommitted changes.

Signed-off-by: Nikhil-Ladha <[email protected]>
  • Loading branch information
Nikhil-Ladha committed Aug 13, 2024
1 parent 869aace commit 5386a80
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ permissions:
contents: read

jobs:
uncommitted-code-check:
name: uncommitted-code-check
runs-on: ubuntu-latest
steps:
- name: Check generated deploy code
run: make generate-deploy

- name: Check for uncommitted changes for deploy directory
run: make check-deploy-committed

- name: Show the uncommitted "git diff"
if: ${{ failure() }}
run: git diff ; false
e2e-build-test:
name: e2e-build-test
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ generate-deploy:
go mod vendor
$(MAKE) -C deploy

.PHONY: check-deploy-committed
check-deploy-committed: ## Fail in case there are uncommitted changes for deploy directory
test -z "$(shell git status --short)" || (echo "files were modified: " ; git status --short ; false)

#
# e2e testing by compiling e2e.test in case it does not exist and running the
# executable. The e2e.test executable is not checked as a dependency in the
Expand Down

0 comments on commit 5386a80

Please sign in to comment.