@@ -57,28 +57,73 @@ jobs:
5757 NODE_OPTIONS : --max_old_space_size=16384
5858 run : xvfb-run npm run test:coverage --silent
5959
60+ # Install and start KinD cluster
6061 - name : Start KinD cluster
6162 if : (success() || failure()) && runner.os == 'Linux'
6263 uses : helm/kind-action@v1.14.0
6364 with :
6465 version : v0.31.0
6566 node_image : kindest/node:v1.34.0
6667
68+ # Configure cluster
6769 - name : Configure cluster
6870 if : (success() || failure()) && runner.os == 'Linux'
6971 run : |
70- curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.19.1/install.sh | bash -s v0.19.1
71- kubectl create -f https://operatorhub.io/install/service-binding-operator.yaml
72- kubectl create -f https://operatorhub.io/install/cloudnative-pg.yaml
73- nb=0
74- echo -n "Waiting for operator to show up "
75- while [ "$nb" != "2" ]
76- do
72+ set -euo pipefail
73+
74+ echo "Installing CloudNativePG..."
75+ kubectl create -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.28/releases/cnpg-1.28.1.yaml
76+
77+ echo "Installing OLM (for SBO)..."
78+ kubectl create -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.42.0/crds.yaml
79+ kubectl create -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.42.0/olm.yaml
80+
81+ kubectl wait --for=condition=Available deployment -n olm --all --timeout=180s
82+
83+ echo "Installing Service Binding Operator via OLM..."
84+ kubectl apply -f https://operatorhub.io/install/service-binding-operator.yaml
85+
86+ echo "Waiting for operators..."
87+
88+ # CNPG
89+ kubectl wait --for=condition=Available deployment -n cnpg-system --all --timeout=180s
90+
91+ # OLM async flow
92+ echo -n "Waiting for Service Binding Operator CSV to appear "
93+
94+ timeout=300
95+ elapsed=0
96+
97+ while ! kubectl get csv -n operators 2>/dev/null | grep -q service-binding-operator; do
7798 echo -n "."
7899 sleep 1
79- nb=`kubectl get pods -n operators --no-headers --ignore-not-found | grep Running | wc -l`
100+ elapsed=$((elapsed+1))
101+
102+ if [ "$elapsed" -ge "$timeout" ]; then
103+ echo ""
104+ echo "❌ Timeout waiting for Service Binding Operator CSV"
105+
106+ kubectl get subscription -n operators || true
107+ kubectl get installplan -n operators || true
108+ kubectl get csv -n operators || true
109+ kubectl get pods -n operators || true
110+
111+ exit 1
112+ fi
80113 done
81- echo CLUSTER_URL=`kubectl cluster-info | sed -n -e "s/\x1B\[[0-9;]*[a-zA-Z]//g" -e '1s/.*running at \(.*\)$/\1/p'` >> $GITHUB_ENV
114+
115+ echo ""
116+
117+ echo "Waiting for Service Binding Operator CSV to succeed..."
118+ kubectl wait --for=jsonpath='{.status.phase}'=Succeeded \
119+ csv -n operators --all --timeout=300s
120+
121+ # Now safe
122+ kubectl wait --for=condition=Available deployment -n operators --all --timeout=180s
123+
124+ echo "Extracting cluster URL..."
125+ echo "CLUSTER_URL=$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}')" >> $GITHUB_ENV
126+
82127 # UI tests fail under linux
83128 # Run UI tests
84129 - name : Run UI Tests
0 commit comments