ci: add test for uncommitted changes in deploy directory

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 <nikhilladha1999@gmail.com>
(cherry picked from commit 71cbf3d7eb)
This commit is contained in:
Nikhil-Ladha 2024-08-13 12:29:40 +05:30 committed by mergify[bot]
parent 41fe80d303
commit 7a46d253a2
3 changed files with 24 additions and 0 deletions

View File

@ -9,6 +9,22 @@ permissions:
contents: read contents: read
jobs: jobs:
uncommitted-code-check:
name: uncommitted-code-check
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Check generated deploy code
run: make generate-deploy
- name: Check for uncommitted changes
run: make check-all-committed
- name: Show the uncommitted "git diff"
if: ${{ failure() }}
run: git diff ; false
go-test: go-test:
name: go-test name: go-test
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -34,6 +34,7 @@ queue_rules:
- "status-success=golangci-lint" - "status-success=golangci-lint"
- "status-success=mod-check" - "status-success=mod-check"
- "status-success=lint-extras" - "status-success=lint-extras"
- "status-success=uncommitted-code-check"
- "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.27"
- "status-success=ci/centos/k8s-e2e-external-storage/1.28" - "status-success=ci/centos/k8s-e2e-external-storage/1.28"
- "status-success=ci/centos/k8s-e2e-external-storage/1.29" - "status-success=ci/centos/k8s-e2e-external-storage/1.29"
@ -75,6 +76,7 @@ queue_rules:
- "status-success=golangci-lint" - "status-success=golangci-lint"
- "status-success=mod-check" - "status-success=mod-check"
- "status-success=lint-extras" - "status-success=lint-extras"
- "status-success=uncommitted-code-check"
- "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.27"
- "status-success=ci/centos/k8s-e2e-external-storage/1.28" - "status-success=ci/centos/k8s-e2e-external-storage/1.28"
- "status-success=ci/centos/k8s-e2e-external-storage/1.29" - "status-success=ci/centos/k8s-e2e-external-storage/1.29"
@ -190,6 +192,7 @@ pull_request_rules:
- "status-success=lint-extras" - "status-success=lint-extras"
- "status-success=mod-check" - "status-success=mod-check"
- "status-success=multi-arch-build" - "status-success=multi-arch-build"
- "status-success=uncommitted-code-check"
- "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.27"
- "status-success=ci/centos/k8s-e2e-external-storage/1.28" - "status-success=ci/centos/k8s-e2e-external-storage/1.28"
- "status-success=ci/centos/k8s-e2e-external-storage/1.29" - "status-success=ci/centos/k8s-e2e-external-storage/1.29"
@ -280,6 +283,7 @@ pull_request_rules:
- "status-success=mod-check" - "status-success=mod-check"
- "status-success=lint-extras" - "status-success=lint-extras"
- "#changes-requested-reviews-by=0" - "#changes-requested-reviews-by=0"
- "status-success=uncommitted-code-check"
- "status-success=ci/centos/k8s-e2e-external-storage/1.27" - "status-success=ci/centos/k8s-e2e-external-storage/1.27"
- "status-success=ci/centos/k8s-e2e-external-storage/1.28" - "status-success=ci/centos/k8s-e2e-external-storage/1.28"
- "status-success=ci/centos/k8s-e2e-external-storage/1.29" - "status-success=ci/centos/k8s-e2e-external-storage/1.29"

View File

@ -179,6 +179,10 @@ generate-deploy:
go mod vendor go mod vendor
$(MAKE) -C deploy $(MAKE) -C deploy
.PHONY: check-all-committed
check-all-committed: ## Fail in case there are uncommitted changes
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 # 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 # executable. The e2e.test executable is not checked as a dependency in the