|
| 1 | +name: DevLake Helm Smoke Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "**" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "**" ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + smoke-test: |
| 11 | + name: Smoke Test |
| 12 | + runs-on: ubuntu-latest |
| 13 | + timeout-minutes: 50 |
| 14 | + env: |
| 15 | + RELEASE_NAME: devlake |
| 16 | + NAMESPACE: devlake |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v5 |
| 20 | + |
| 21 | + - name: Set up Helm |
| 22 | + uses: azure/setup-helm@v4 |
| 23 | + |
| 24 | + - name: Create kind cluster |
| 25 | + uses: helm/kind-action@v1.12.0 |
| 26 | + with: |
| 27 | + cluster_name: devlake-e2e |
| 28 | + |
| 29 | + - name: Set up kubectl |
| 30 | + uses: azure/setup-kubectl@v4 |
| 31 | + |
| 32 | + - name: Add Helm repos |
| 33 | + run: | |
| 34 | + helm repo add grafana https://grafana.github.io/helm-charts |
| 35 | + helm repo update |
| 36 | +
|
| 37 | + - name: Build chart dependencies |
| 38 | + run: | |
| 39 | + helm dependency build charts/devlake |
| 40 | +
|
| 41 | + - name: Install DevLake chart |
| 42 | + run: | |
| 43 | + kubectl get events -n "$NAMESPACE" -w & |
| 44 | + kubectl get pods -n "$NAMESPACE" -w & |
| 45 | + ENCRYPTION_SECRET=$(openssl rand -base64 2000 | tr -dc 'A-Z' | fold -w 128 | head -n 1) |
| 46 | + helm install "$RELEASE_NAME" ./charts/devlake \ |
| 47 | + --namespace "$NAMESPACE" \ |
| 48 | + --create-namespace \ |
| 49 | + --wait \ |
| 50 | + --set lake.encryptionSecret.secret="${ENCRYPTION_SECRET}" |
| 51 | +
|
| 52 | + - name: Dump diagnostics on failure |
| 53 | + if: failure() |
| 54 | + run: | |
| 55 | + echo "=== Helm status for release ===" |
| 56 | + helm status "$RELEASE_NAME" -n "$NAMESPACE" || true |
| 57 | + echo "=== Kubernetes resources (all) ===" |
| 58 | + kubectl get all -n "$NAMESPACE" -o wide || true |
| 59 | + echo "=== Kubernetes events (latest 200) ===" |
| 60 | + kubectl get events -n "$NAMESPACE" --sort-by=.lastTimestamp | tail -n 200 || true |
| 61 | + echo "=== Describe deployments/statefulsets ===" |
| 62 | + kubectl describe deploy -n "$NAMESPACE" || true |
| 63 | + kubectl describe statefulset -n "$NAMESPACE" || true |
| 64 | + echo "=== Describe pods ===" |
| 65 | + kubectl describe pods -n "$NAMESPACE" || true |
| 66 | + echo "=== Logs from all pods (current and previous, last 200 lines) ===" |
| 67 | + for pod in $(kubectl get pods -n "$NAMESPACE" -o jsonpath='{.items[*].metadata.name}'); do |
| 68 | + echo "----- logs for ${pod} -----" |
| 69 | + kubectl logs -n "$NAMESPACE" "$pod" --all-containers --tail=200 || true |
| 70 | + echo "----- previous logs for ${pod} -----" |
| 71 | + kubectl logs -n "$NAMESPACE" "$pod" --all-containers --previous --tail=200 || true |
| 72 | + done |
0 commit comments