@@ -20,11 +20,30 @@ jobs:
2020 - name : Checkout repository
2121 uses : actions/checkout@v5
2222
23+ - name : Enable Prometheus in kustomize (testdata sample)
24+ run : |
25+ sed -i 's/^#- \.\.\/prometheus/- ..\/prometheus/' testdata/project-v4-with-plugins/config/default/kustomization.yaml
26+
27+ - name : Build kubebuilder CLI
28+ run : make build
29+
2330 - name : Setup Go
2431 uses : actions/setup-go@v6
2532 with :
2633 go-version-file : go.mod
2734
35+ - name : Prepare project-v4-with-plugins
36+ run : |
37+ cd testdata/project-v4-with-plugins/
38+ go mod tidy
39+ make all
40+
41+ - name : Rebuild installer and regenerate Helm chart (v2-alpha)
42+ working-directory : testdata/project-v4-with-plugins
43+ run : |
44+ make build-installer
45+ ../../bin/kubebuilder edit --plugins=helm/v2-alpha --force
46+
2847 - name : Install the latest version of kind
2948 run : |
3049 curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
3756 - name : Create kind cluster
3857 run : kind create cluster
3958
40- - name : Prepare project-v4-with-plugins
41- run : |
42- cd testdata/project-v4-with-plugins/
43- go mod tidy
44- make docker-build IMG=project-v4-with-plugins:v0.1.0
45- kind load docker-image project-v4-with-plugins:v0.1.0
46-
4759 - name : Install Helm
4860 run : |
4961 curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
5567 run : |
5668 helm lint testdata/project-v4-with-plugins/dist/chart
5769
70+ - name : Build project-v4-with-plugins
71+ run : |
72+ cd testdata/project-v4-with-plugins/
73+ go mod tidy
74+ make docker-build IMG=project-v4-with-plugins:v0.1.0
75+ kind load docker-image project-v4-with-plugins:v0.1.0
76+
5877 - name : Install Prometheus Operator CRDs
5978 run : |
6079 helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
@@ -79,15 +98,20 @@ jobs:
7998
8099 - name : Install Helm chart for project-v4-with-plugins
81100 run : |
82- helm install my-release testdata/project-v4-with-plugins/dist/chart --create-namespace --namespace project-v4-with-plugins-system --set prometheus.enable=true
101+ helm install my-release \
102+ testdata/project-v4-with-plugins/dist/chart \
103+ --namespace project-v4-with-plugins-system \
104+ --create-namespace \
105+ --set prometheus.enable=true
83106
84107 - name : Check Helm release status
85108 run : |
86109 helm status my-release --namespace project-v4-with-plugins-system
87110
88- - name : Check Presence of ServiceMonitor
111+ - name : Delete kind cluster
112+ if : always()
89113 run : |
90- kubectl wait --namespace project-v4-with-plugins-system --for=jsonpath='{.kind}'=ServiceMonitor servicemonitor/project-v4-with-plugins-controller-manager-metrics-monitor
114+ kind delete cluster || true
91115
92116 # Test scenario:
93117 # - scaffold project without creating webhooks,
97121 # Command to use to scaffold project without creating webhooks and so no need to install cert manager:
98122 # - kubebuilder init
99123 # - kubebuilder create api --group example.com --version v1 --kind App --controller=true --resource=true
100- # - kubebuilder edit --plugins=helm.kubebuilder.io/v1 -alpha
124+ # - kubebuilder edit --plugins=helm.kubebuilder.io/v2 -alpha
101125 test-helm-no-webhooks :
102126 runs-on : ubuntu-latest
103127 if : github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
@@ -149,9 +173,18 @@ jobs:
149173
150174 - name : Deploy Helm chart without cert-manager
151175 working-directory : test-helm-no-webhooks
152- run : helm install my-release ./dist/chart --create-namespace --namespace test-helm-no-webhooks-system
176+ run : |
177+ helm install my-release \
178+ ./dist/chart \
179+ --create-namespace \
180+ --namespace test-helm-no-webhooks-system
153181
154182 - name : Verify deployment is working
155183 working-directory : test-helm-no-webhooks
156184 run : |
157185 helm status my-release --namespace test-helm-no-webhooks-system
186+
187+ - name : Delete kind cluster
188+ if : always()
189+ run : |
190+ kind delete cluster || true
0 commit comments