| name: E2E checks |
| on: |
| pull_request: |
| types: [opened, synchronize, reopened, ready_for_review] |
| paths-ignore: |
| - "LICENSE" |
| - "**/.gitignore" |
| - "**.md" |
| - "**.adoc" |
| - "*.txt" |
| - "docsimg/**" |
| - ".ci/jenkins/**" |
| |
| env: |
| GO_VERSION: 1.19 |
| # Kubernetes version should aligned with OCP LTS, aka OCP 4.10 (k8s 1.23) for now |
| # https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.23.md |
| # WARNING: kindest/node is not always existing with given version ... |
| KUBERNETES_VERSION: v1.26.3 |
| DEBUG: true |
| |
| jobs: |
| e2e: |
| concurrency: |
| group: sonataflow-operator-e2e-tests-${{ github.head_ref }} |
| cancel-in-progress: true |
| timeout-minutes: 120 |
| runs-on: ubuntu-latest |
| name: End-to-end tests (Minikube) |
| steps: |
| - name: Install package |
| run: | |
| sudo apt-get -y install \ |
| btrfs-progs \ |
| libgpgme-dev \ |
| libbtrfs-dev \ |
| libdevmapper-dev \ |
| libkrb5-dev |
| |
| - name: Checkout Code |
| uses: actions/checkout@v3 |
| with: |
| ref: ${{ github.event.pull_request.head.sha }} |
| |
| - name: Install Go |
| uses: actions/setup-go@v3 |
| with: |
| go-version: ${{ env.GO_VERSION }} |
| cache: true |
| |
| - name: Setup Minikube cluster |
| # Should be set back with correct version once https://github.com/radtriste/setup-minikube/tree/issue_49 is done |
| uses: medyagh/setup-minikube@v0.0.10 |
| with: |
| addons: registry,metrics-server |
| kubernetes-version: ${{ env.KUBERNETES_VERSION }} |
| # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources |
| cpus: max |
| memory: max |
| insecure-registry: localhost:5000,192.168.0.0/16 |
| |
| - name: Wait for Minikube up and running |
| run: | |
| minikube ssh cat /lib/systemd/system/docker.service |
| kubectl get pods -A |
| set -x |
| MINIKUBE_COMPONENTS=(etcd kube-apiserver kube-controller-manager kube-scheduler) |
| for component in "${MINIKUBE_COMPONENTS[@]}" |
| do |
| echo "Check component '${component}' is in 'Running' state" |
| COMPONENT_NAME=${component} timeout 60s bash -c 'kubectl get pods -l tier=control-plane -l component=${COMPONENT_NAME} -n kube-system && while [[ "$(kubectl get pods -l tier=control-plane -l component=${COMPONENT_NAME} -n kube-system -o jsonpath={.items[0].status.phase})" != "Running" ]] ; do sleep 2 && kubectl get pods -l tier=control-plane -l component=${COMPONENT_NAME} -n kube-system -o jsonpath={.items[0].status.phase}; done' |
| done |
| |
| |
| - name: Wait for Minikube registry |
| run: | |
| kubectl get pods -A |
| timeout 60s bash -c 'kubectl get pods -l kubernetes.io/minikube-addons=registry -l actual-registry=true -n kube-system && while [[ "$(kubectl get pods -l kubernetes.io/minikube-addons=registry -l actual-registry=true -n kube-system -o jsonpath={.items[0].status.phase})" != "Running" ]] ; do sleep 2 && kubectl get pods -l kubernetes.io/minikube-addons=registry -l actual-registry=true -n kube-system -o jsonpath={.items[0].status.phase}; done' |
| |
| |
| - name: Retrieve Minikube registry |
| run: | |
| minikube_registry="$(minikube ip):5000" |
| echo "MINIKUBE_REGISTRY=${minikube_registry}" >> $GITHUB_ENV |
| echo "OPERATOR_IMAGE_NAME=${minikube_registry}/kogito-serverless-operator:0.0.1" >> $GITHUB_ENV |
| |
| - name: Setup Python for cekit |
| uses: actions/setup-python@v4 |
| with: |
| python-version: '3.10' |
| |
| # TODO: cache this installation |
| - name: Build operator image |
| run: | |
| pip install cekit==4.5.0 |
| pip install odcs podman behave lxml krb5 |
| make container-build BUILDER=podman IMG=${{ env.OPERATOR_IMAGE_NAME }} |
| |
| - name: Load image in Minikube |
| run: | |
| podman push --tls-verify=false ${{ env.OPERATOR_IMAGE_NAME }} |
| |
| - name: Check pods |
| run: | |
| kubectl version |
| kubectl get pods -A |
| |
| # TODO: install the operator-sdk first, then cache the installation |
| - name: Run tests |
| run: | |
| make test-e2e |