Add - GithubAction For Incoming e2e Test Case #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
env: | |
ImageName: redis-operator | |
ImageTag: test | |
jobs: | |
e2e: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Create k8s Kind Cluster | |
uses: helm/[email protected] | |
with: | |
config: "./kind-config.yaml" | |
- name: Extract and encode kubeconfig from kind | |
run: | | |
kubectl config view --minify --flatten > ./kubeconfig.yml | |
echo "KUBE_CONFIG_DATA=$(cat ./kubeconfig.yml | base64 | tr -d '\n')" >> $GITHUB_ENV | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build multi-arch image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
platforms: linux/arm64,linux/amd64 | |
push: false | |
tags: ${{ env.ImageName }}:${{ env.ImageTag }} | |
- name: deploy redis-operator to cluster | |
uses: wahyd4/kubectl-helm-action@master | |
env: | |
KUBE_CONFIG_DATA: ${{ env.KUBE_CONFIG_DATA }} | |
with: | |
args: | | |
helm repo add ot-helm https://ot-container-kit.github.io/helm-charts/ | |
helm repo update | |
helm install --create-namespace --namespace=ot-container redis-operator ot-helm/redis-operator \ | |
--set redisOperator.imageName=${{ env.ImageName }} --set redisOperator.imageTag=${{ env.ImageTag }} \ | |
--set redisOperator.imagePullPolicy=Never | |
- name: Install kuttl | |
run: | | |
curl -L https://github.com/kudobuilder/kuttl/releases/download/v0.15.0/kubectl-kuttl_0.15.0_linux_x86_64 -o /usr/local/bin/kuttl | |
chmod +x /usr/local/bin/kuttl | |
- name: Run e2e test | |
run: | | |
kuttl test |