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..6509bc6 100644 --- a/.github/workflows/helm-lint.yml +++ b/.github/workflows/helm-lint.yml @@ -65,3 +65,19 @@ jobs: - name: Run Helm lint on ToolJet chart run: | helm lint ${{ steps.chart-path.outputs.path }} --strict + + - 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"