diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index d2a57c2..0a40ff4 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -131,6 +131,20 @@ jobs: comment: Auto-closing pull request delete-branch: true - name: Check Result + run: | + kubectl logs deployment/piper + kubectl get workflows.argoproj.io -n workflows + BRANCH_VALID_STRING=$(echo ${{ github.ref_name }}-test | tr '[:upper:]' '[:lower:]' | tr '_' '-' | tr -cd 'a-z0-9.\-') + + ## check if created + RESULT=$(kubectl get workflows.argoproj.io -n workflows --selector=branch=$BRANCH_VALID_STRING --no-headers | grep piper-e2e-test) + [ ! -z "$RESULT" ] && echo "CRD created $RESULT" || { echo "Workflow not exists, existing..."; exit 1; } + + ## check if status phase not Failed, if yes, show message + RESULT=$(kubectl get workflows.argoproj.io -n workflows --selector=branch=$BRANCH_VALID_STRING --no-headers -o custom-columns="Status:status.phase") + MESSAGE=$(kubectl get workflows.argoproj.io -n workflows --selector=branch=$BRANCH_VALID_STRING --no-headers -o custom-columns="Status:status.message") + [ ! "$RESULT" == "Failed" ] && echo "CRD created $MESSAGE" || { echo "Workflow Failed $MESSAGE, existing..."; exit 1; } + github-e2e-env: name: E2E Tests (on development) runs-on: ubuntu-latest