Skip to content

Commit 89955a1

Browse files
committed
fixup! [FLINK-36332] reusable workflow
1 parent e5bb8ce commit 89955a1

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

.github/workflows/e2e.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: E2E test workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
java-version:
7+
required: true
8+
type: string
9+
flink-version:
10+
required: true
11+
type: string
12+
flink-image:
13+
required: true
14+
type: string
15+
http-clinet:
16+
required: false
17+
type: string
18+
default: "okhttp"
19+
namespace:
20+
required: false
21+
type: string
22+
default: "default"
23+
mode:
24+
required: false
25+
type: string
26+
default: "native"
27+
test:
28+
required: true
29+
type: string
30+
31+
jobs:
32+
e2e_test:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: Set up JDK ${{ inputs.java-version }}
37+
uses: actions/setup-java@v4
38+
with:
39+
java-version: ${{ inputs.java-version }}
40+
distribution: 'temurin'
41+
cache: 'maven'
42+
- name: Start minikube
43+
run: |
44+
source e2e-tests/utils.sh
45+
start_minikube
46+
- name: Install cert-manager
47+
run: |
48+
kubectl get pods -A
49+
kubectl apply -f e2e-tests/cert-manager.yaml
50+
kubectl -n cert-manager wait --all=true --for=condition=Available --timeout=300s deploy
51+
- name: Build image
52+
run: |
53+
export SHELL=/bin/bash
54+
export DOCKER_BUILDKIT=1
55+
eval $(minikube -p minikube docker-env)
56+
JAVA_VERSION=${{inputs.java-version}}
57+
HTTP_CLIENT=${{ inputs.http-client }}
58+
docker build --progress=plain --no-cache -f ./Dockerfile -t flink-kubernetes-operator:ci-latest --progress plain --build-arg JAVA_VERSION="${JAVA_VERSION:-11}" --build-arg HTTP_CLIENT="${HTTP_CLIENT:-okhttp}" .
59+
docker images
60+
- name: Start the operator
61+
run: |
62+
helm --debug install flink-kubernetes-operator -n ${{ inputs.namespace }} helm/flink-kubernetes-operator --set image.repository=flink-kubernetes-operator --set image.tag=ci-latest
63+
kubectl wait --for=condition=Available --timeout=120s -n ${{ inputs.namespace }} deploy/flink-kubernetes-operator
64+
kubectl get pods -n ${{ inputs.namespace }}
65+
- name: Run Flink e2e tests
66+
run: |
67+
sed -i "s/image: flink:.*/image: ${{ inputs.flink-version.image }}/" e2e-tests/data/*.yaml
68+
sed -i "s/flinkVersion: .*/flinkVersion: ${{ inputs.flink-version.tag }}/" e2e-tests/data/*.yaml
69+
sed -i "s/mode: .*/mode: ${{ inputs.mode }}/" e2e-tests/data/*.yaml
70+
git diff HEAD
71+
echo "Running e2e-tests/$test"
72+
bash e2e-tests/${{ inputs.test }} || exit 1
73+
git reset --hard
74+
- name: Stop the operator
75+
run: |
76+
helm uninstall -n ${{ inputs.namespace }} flink-kubernetes-operator
77+
- name: Stop minikube
78+
run: |
79+
source e2e-tests/utils.sh
80+
stop_minikube
81+

0 commit comments

Comments
 (0)