Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add - GithubAction For Incoming e2e Test Case #579

Closed
wants to merge 17 commits into from
14 changes: 7 additions & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '24 4 * * 5'
# push:
# branches: [ master ]
# pull_request:
# # The branches below must be a subset of the branches above
# branches: [ master ]
# schedule:
# - cron: '24 4 * * 5'

jobs:
analyze:
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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/kind-action@v1.5.0
with:
config: "./tests/_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 image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64
push: false
tags: ${{ env.ImageName }}:${{ env.ImageTag }}

- name: Set up Helm
uses: azure/setup-helm@v3.5
with:
version: v3.11.2

- name: Deploy Redis Operator with Helm
run: |
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 --wait --timeout 5m

- name: Show Pods - DEBUG
run: |
kubectl get pods -n ot-container

- 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 --config ./tests/_config/kuttl-test.yaml
14 changes: 7 additions & 7 deletions .github/workflows/operator-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
# pull_request:
# branches:
# - master
# push:
# branches:
# - master

env:
GolangVersion: 1.17
Expand Down Expand Up @@ -125,4 +125,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

GOSEC_OUTPUT: "junit-xml:/github/workspace/gosec-results.xml"

8 changes: 4 additions & 4 deletions .github/workflows/release-images.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Release container images

on:
pull_request:
types: [closed]
branches:
- master
# pull_request:
# types: [closed]
# branches:
# - master

env:
ApplicationName: redis-operator
Expand Down
6 changes: 6 additions & 0 deletions kind-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
Empty file added kuttl-test.yaml
Empty file.
2 changes: 2 additions & 0 deletions tests/_config/kuttl-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ startKIND: false
kindConfig: "./kind-config.yaml"
parallel: 1
timeout: 300
testDirs:
- ./tests/e2e
suppress :
- events