Skip to content

Commit 577ba69

Browse files
luxldet101
authored andcommitted
use matrix run
1 parent cc1eeaa commit 577ba69

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

.github/workflows/e2e-k8s.yml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,14 @@ jobs:
4545
not-ignore:
4646
- '!(docs/**)'
4747
e2e-k8s:
48-
name: E2E-K8S-Execute
48+
name: E2E-K8S-Execute (${{ matrix.db }})
4949
needs: paths-filter
5050
if: ${{ (needs.paths-filter.outputs.not-ignore == 'true') || (github.event_name == 'push') }}
5151
runs-on: ubuntu-latest
5252
timeout-minutes: 40
53+
strategy:
54+
matrix:
55+
db: [mysql, postgresql]
5356
steps:
5457
- uses: actions/checkout@v4
5558
with:
@@ -114,22 +117,14 @@ jobs:
114117
fi
115118
kind load docker-image apache/dolphinscheduler-$component:ci --name dolphinscheduler
116119
done
117-
- name: Deploy standalone MySQL on K8s
120+
- name: Deploy standalone MySQL on K8s (only for mysql)
121+
if: matrix.db == 'mysql'
118122
working-directory: ${{ github.workspace }}/deploy/kubernetes/dolphinscheduler
119123
run: |
120-
# Create namespace first
121124
kubectl create namespace dolphinscheduler
122-
123-
# Apply the manifests to deploy MySQL
124125
kubectl apply -n dolphinscheduler -f mysql-k8s.yaml
125-
126-
# Wait for MySQL to be ready before proceeding
127126
echo "Waiting for MySQL to be ready..."
128127
kubectl wait --for=condition=available --timeout=300s deployment/mysql -n dolphinscheduler
129-
130-
kubectl get pods -n dolphinscheduler
131-
kubectl get svc -n dolphinscheduler
132-
echo "Waiting for MySQL service to be ready..."
133128
MYSQL_POD=$(kubectl get pods -n dolphinscheduler -l app=mysql -o jsonpath="{.items[0].metadata.name}")
134129
for i in {1..30}; do
135130
if kubectl exec "$MYSQL_POD" -n dolphinscheduler -- mysql -uroot -proot -e "SELECT 1"; then
@@ -140,21 +135,18 @@ jobs:
140135
sleep 5
141136
fi
142137
done
143-
144138
if [ "$i" -eq 30 ]; then
145139
echo "MySQL did not become ready within the timeout period."
146140
kubectl describe pod "$MYSQL_POD" -n dolphinscheduler
147-
echo "pod logs"
148141
kubectl logs "$MYSQL_POD" -n dolphinscheduler
149142
exit 1
150143
fi
151144
152145
- name: Helm upgrade dolphinscheduler with mysql config
146+
if: matrix.db == 'mysql'
153147
working-directory: ${{ github.workspace }}/deploy/kubernetes/dolphinscheduler
154148
run: |
155-
# install helm
156149
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
157-
158150
helm repo add bitnami https://charts.bitnami.com/bitnami
159151
helm dependency update .
160152
helm upgrade --install --debug --create-namespace -n dolphinscheduler dolphinscheduler . \
@@ -170,14 +162,14 @@ jobs:
170162
--set externalDatabase.database="dolphinscheduler" \
171163
--set master.replicas=1 \
172164
--set worker.replicas=1
173-
165+
174166
- name: Helm upgrade dolphinscheduler with pgsql config
167+
if: matrix.db == 'postgresql'
175168
working-directory: ${{ github.workspace }}/deploy/kubernetes/dolphinscheduler
176169
run: |
177-
ls mysql-k8s.yaml
178-
kubectl delete -f mysql-k8s.yaml -n dolphinscheduler
179-
helm uninstall dolphinscheduler -n dolphinschedule
180-
kubectl delete namespace dolphinscheduler
170+
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
171+
helm repo add bitnami https://charts.bitnami.com/bitnami
172+
helm dependency update .
181173
helm upgrade --install --debug --create-namespace -n dolphinscheduler dolphinscheduler . \
182174
--set image.tag=ci \
183175
--set postgresql.enabled=true \

0 commit comments

Comments
 (0)