-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "Setup kind cluster" | ||
description: "Creates a kind cluster to be used elsewhere" | ||
inputs: # adding these parameters to make this reusable later on | ||
kind_cluster_name: | ||
description: "The kind cluster name to use" | ||
required: true | ||
default: "e2e-kind" | ||
kind_k8s_version: | ||
description: 'The k8s version to use' | ||
required: true | ||
default: 'v1.24.15' | ||
kind_config: | ||
description: 'Path to the kind config to use' | ||
required: true | ||
default: 'tests/e2e/platforms/kind/kind_config.yaml' | ||
outputs: | ||
kubeconfig: | ||
description: 'Path of the resulting kubeconfig' | ||
value: ${{ steps.check-kind-cluster.outputs.kubeconfig }} | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- uses: engineerd/[email protected] | ||
with: | ||
name: ${{ inputs.kind_cluster_name }} | ||
version: v0.20.0 | ||
image: kindest/node:${{ inputs.kind_k8s_version }} | ||
config: ${{ inputs.kind_config }} | ||
|
||
- name: Check kind cluster and extract kubeconfig | ||
id: check-kind-cluster | ||
run: | | ||
kubectl version | ||
kubectl cluster-info | ||
kubectl get pods -n kube-system | ||
echo "current-context:" $(kubectl config current-context) | ||
echo "environment-kubeconfig:" ${KUBECONFIG} | ||
mkdir tests/e2e/platforms/kind/${{ inputs.kind_k8s_version }} | ||
kubeconfig_path=$(pwd)/tests/e2e/platforms/kind/${{ inputs.kind_k8s_version }}/kind.kconf | ||
kind get kubeconfig --name ${{ inputs.kind_cluster_name }} > $kubeconfig_path | ||
echo "kubeconfig=$(echo $kubeconfig_path)" >> $GITHUB_OUTPUT | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: e2e-test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- add_kind_ci_execution | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Kind cluster | ||
id: setup-kind | ||
uses: ./.github/actions/kind-create | ||
|
||
- name: run tests | ||
env: | ||
KUBECONFIG: ${{ steps.setup-kind.outputs.kubeconfig }} | ||
run: | | ||
go get github.com/banzaicloud/koperator/tests/e2e | ||
make test-e2e |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
- role: worker | ||
- role: worker | ||
- role: worker |