From 721f0d953677c56ff299b90d1a48a514822b7b6f Mon Sep 17 00:00:00 2001 From: Adish M Date: Thu, 11 Dec 2025 16:29:36 +0530 Subject: [PATCH 1/2] Add Helm deployment test and dry-run validation to workflows --- .github/workflows/helm-deploy-test.yml | 89 ++++++++++++++++++++++++++ .github/workflows/helm-lint.yml | 15 +++++ 2 files changed, 104 insertions(+) create mode 100644 .github/workflows/helm-deploy-test.yml diff --git a/.github/workflows/helm-deploy-test.yml b/.github/workflows/helm-deploy-test.yml new file mode 100644 index 0000000..762e35b --- /dev/null +++ b/.github/workflows/helm-deploy-test.yml @@ -0,0 +1,89 @@ +name: Helm Deployment Test + +on: + schedule: + - cron: '0 10 * * 1' # Mondays 10 AM UTC (1 hour after lint) + workflow_dispatch: + +jobs: + deploy-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Helm + uses: azure/setup-helm@v3 + with: + version: 'v3.14.0' + + - name: Add Bitnami Helm repository + run: | + helm repo add bitnami https://charts.bitnami.com/bitnami + helm repo update + timeout-minutes: 5 + + - name: Determine chart path + id: chart-path + run: | + if [ -f "Chart.yaml" ]; then + echo "path=." >> $GITHUB_OUTPUT + elif [ -d "charts/tooljet" ]; then + echo "path=charts/tooljet" >> $GITHUB_OUTPUT + else + echo "Error: Chart not found" + exit 1 + fi + + - name: Update Helm chart dependencies + run: | + cd ${{ steps.chart-path.outputs.path }} + helm dependency update + + - name: Create Kind Kubernetes cluster + uses: helm/kind-action@v1.8.0 + with: + cluster_name: tooljet-test + wait: 120s + + - name: Verify cluster is ready + run: | + kubectl cluster-info + kubectl get nodes + + - name: Deploy ToolJet chart + run: | + helm install tooljet ${{ steps.chart-path.outputs.path }} \ + --namespace tooljet \ + --create-namespace \ + --wait \ + --timeout 5m \ + --set postgresql.enabled=true \ + --set redis.enabled=false \ + --debug + + - name: Verify deployment + run: | + echo "📊 Checking deployed resources..." + kubectl get all -n tooljet + + echo "" + echo "⏳ Waiting for pods to be ready..." + kubectl wait --for=condition=ready pod \ + -l app.kubernetes.io/instance=tooljet \ + -n tooljet \ + --timeout=300s + + - name: Check pod logs + if: always() + run: | + echo "📋 Pod logs:" + kubectl logs -n tooljet -l app.kubernetes.io/instance=tooljet --tail=50 || true + + - name: Cleanup + if: always() + run: | + helm uninstall tooljet -n tooljet || true diff --git a/.github/workflows/helm-lint.yml b/.github/workflows/helm-lint.yml index 8d70ad4..b1175a4 100644 --- a/.github/workflows/helm-lint.yml +++ b/.github/workflows/helm-lint.yml @@ -65,3 +65,18 @@ jobs: - name: Run Helm lint on ToolJet chart run: | helm lint ${{ steps.chart-path.outputs.path }} --strict + + - name: Test Helm deployment (dry-run) + run: | + helm install test-release ${{ steps.chart-path.outputs.path }} \ + --dry-run \ + --debug \ + --namespace test \ + --create-namespace + + - name: Validate template rendering + run: | + helm template test-release ${{ steps.chart-path.outputs.path }} \ + --namespace test > /tmp/rendered.yaml + echo "✅ Templates rendered successfully" + echo "📊 Total lines rendered: $(wc -l < /tmp/rendered.yaml)" From c5dd0d383fa729bd12d58fcc2757859654b24b7b Mon Sep 17 00:00:00 2001 From: Adish M Date: Thu, 11 Dec 2025 17:26:58 +0530 Subject: [PATCH 2/2] Remove dry-run Helm deployment step and enhance template rendering validation --- .github/workflows/helm-lint.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/helm-lint.yml b/.github/workflows/helm-lint.yml index b1175a4..6509bc6 100644 --- a/.github/workflows/helm-lint.yml +++ b/.github/workflows/helm-lint.yml @@ -66,17 +66,18 @@ jobs: run: | helm lint ${{ steps.chart-path.outputs.path }} --strict - - name: Test Helm deployment (dry-run) - run: | - helm install test-release ${{ steps.chart-path.outputs.path }} \ - --dry-run \ - --debug \ - --namespace test \ - --create-namespace - - name: Validate template rendering run: | + echo "Rendering templates to validate syntax..." helm template test-release ${{ steps.chart-path.outputs.path }} \ --namespace test > /tmp/rendered.yaml + echo "✅ Templates rendered successfully" echo "📊 Total lines rendered: $(wc -l < /tmp/rendered.yaml)" + + # Validate that key resources are present + echo "" + echo "📋 Checking for required resources..." + grep -q "kind: Deployment" /tmp/rendered.yaml && echo " ✓ Deployment found" + grep -q "kind: Service" /tmp/rendered.yaml && echo " ✓ Service found" + grep -q "kind: Secret" /tmp/rendered.yaml && echo " ✓ Secret found"