-
Notifications
You must be signed in to change notification settings - Fork 42
111 lines (96 loc) · 4.2 KB
/
e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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/[email protected]
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