Skip to content

Commit

Permalink
Merge pull request #107 from turkenf/reuse-workflow
Browse files Browse the repository at this point in the history
Add crddiff to Makefile and update the uptest version
  • Loading branch information
turkenf authored May 23, 2023
2 parents e5795fd + 53bc3ba commit 843acc4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
upjet-based-provider: false
secrets:
UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }}
UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }}
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ GO111MODULE = on
KIND_VERSION = v0.15.0
UP_VERSION = v0.14.0
UP_CHANNEL = stable
UPTEST_VERSION = v0.3.0
UPTEST_VERSION = v0.5.0
-include build/makelib/k8s_tools.mk

# Setup Images
Expand Down Expand Up @@ -125,6 +125,25 @@ local-deploy: build controlplane.up local.xpkg.deploy.provider.$(PROJECT_NAME)
# - UPTEST_DATASOURCE_PATH, see https://github.com/upbound/uptest#injecting-dynamic-values-and-datasource
e2e: local-deploy uptest

# TODO: please move this to the common build submodule
# once the use cases mature
crddiff: $(UPTEST)
@$(INFO) Checking breaking CRD schema changes
@for crd in $${MODIFIED_CRD_LIST}; do \
if ! git cat-file -e "$${GITHUB_BASE_REF}:$${crd}" 2>/dev/null; then \
echo "CRD $${crd} does not exist in the $${GITHUB_BASE_REF} branch. Skipping..." ; \
continue ; \
fi ; \
echo "Checking $${crd} for breaking API changes..." ; \
changes_detected=$$($(UPTEST) crddiff revision <(git cat-file -p "$${GITHUB_BASE_REF}:$${crd}") "$${crd}" 2>&1) ; \
if [[ $$? != 0 ]] ; then \
printf "\033[31m"; echo "Breaking change detected!"; printf "\033[0m" ; \
echo "$${changes_detected}" ; \
echo ; \
fi ; \
done
@$(OK) Checking breaking CRD schema changes

.PHONY: uptest e2e
# ====================================================================================
# Special Targets
Expand Down

0 comments on commit 843acc4

Please sign in to comment.