diff --git a/.github/workflows/helm-test-open-webui.yml b/.github/workflows/helm-test-open-webui.yml index f477314..c261f28 100644 --- a/.github/workflows/helm-test-open-webui.yml +++ b/.github/workflows/helm-test-open-webui.yml @@ -4,9 +4,11 @@ on: pull_request: paths: - "charts/open-webui/**" + - ".github/workflows/helm-test-open-webui.yml" push: paths: - "charts/open-webui/**" + - ".github/workflows/helm-test-open-webui.yml" jobs: lint-chart: @@ -28,6 +30,8 @@ jobs: name: Test Chart Deployment runs-on: ubuntu-latest needs: lint-chart + env: + NAMESPACE: test-namespace steps: - name: Checkout Code @@ -45,10 +49,22 @@ jobs: - name: Template open-webui Helm Chart run: | helm template open-webui ./charts/open-webui \ - --namespace test-namespace --create-namespace > open-webui.yaml + --namespace "$NAMESPACE" > open-webui.yaml + + - name: Ensure test namespace + run: | + # Create the namespace + kubectl create namespace "$NAMESPACE" + + # Wait for the namespace to be ready + for i in {1..30}; do + kubectl get namespace "$NAMESPACE" --no-headers && break || sleep 2 + echo "Waiting for namespace '$NAMESPACE' to become available..." + done + + echo "Namespace '$NAMESPACE' is now available." - name: Verify open-webui run: | - kubectl create namespace test-namespace kubectl apply --namespace test-namespace -f open-webui.yaml kubectl wait --namespace test-namespace pod/open-webui-0 --for=condition=Ready --timeout=600s diff --git a/.github/workflows/helm-test-pipelines.yml b/.github/workflows/helm-test-pipelines.yml index bf1ca43..cae02b6 100644 --- a/.github/workflows/helm-test-pipelines.yml +++ b/.github/workflows/helm-test-pipelines.yml @@ -4,9 +4,11 @@ on: pull_request: paths: - "charts/pipelines/**" + - ".github/workflows/helm-test-pipelines.yml" push: paths: - "charts/pipelines/**" + - ".github/workflows/helm-test-pipelines.yml" jobs: lint-chart: @@ -28,6 +30,8 @@ jobs: name: Test Chart Deployment runs-on: ubuntu-latest needs: lint-chart + env: + NAMESPACE: test-namespace steps: - name: Checkout Code @@ -45,7 +49,20 @@ jobs: - name: Template open-webui Helm Chart run: | helm template pipelines ./charts/pipelines \ - --namespace test-namespace --create-namespace > pipelines.yaml + --namespace "$NAMESPACE" > pipelines.yaml + + - name: Ensure test namespace + run: | + # Create the namespace + kubectl create namespace "$NAMESPACE" + + # Wait for the namespace to be ready + for i in {1..30}; do + kubectl get namespace "$NAMESPACE" --no-headers && break || sleep 2 + echo "Waiting for namespace '$NAMESPACE' to become available..." + done + + echo "Namespace '$NAMESPACE' is now available." - name: Verify pipelines run: |