Skip to content

Commit

Permalink
Github action to compare bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
Ygnas committed Sep 13, 2023
1 parent fef810f commit 45c4ac3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,22 @@ jobs:
- name: End-to-end tests
run: |
make test
check-bundles:
name: check-bundles
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Download Kustomize
run: |
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
mv kustomize /usr/local/bin/
- name: Compare Bundles
run: |
if make compare-bundles; then
echo "Bundles comparison succeeded."
else
echo "Bundles comparison failed. Please run 'make generate-bundles' and check in changes."
exit 1
fi
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ else
GOBIN=$(shell go env GOBIN)
endif

SHELL = /usr/bin/env bash -o pipefail

.PHONY: test
test:
./tests/e2e.sh

.PHONY: generate-bundles
generate-bundles:
kustomize build ./config/examples/kube-prometheus | docker run --rm -i ryane/kfilt -i kind=CustomResourceDefinition > ./config/examples/kube-prometheus/bundle_crd.yaml
kustomize build ./config/examples/kube-prometheus | docker run --rm -i ryane/kfilt -x kind=CustomResourceDefinition > ./config/examples/kube-prometheus/bundle.yaml


.PHONY: compare-bundles
compare-bundles: generate-bundles
git diff --exit-code

0 comments on commit 45c4ac3

Please sign in to comment.