Skip to content

Commit

Permalink
Added GHA for e2e test using Kind cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>
  • Loading branch information
lampajr committed Jan 11, 2024
1 parent 3d79147 commit b159cd4
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Controller image deployment and e2e test

on:
pull_request:
paths-ignore:
- 'LICENSE*'
- '**.gitignore'
- '**.md'
- '**.txt'
- '.github/ISSUE_TEMPLATE/**'
- '.github/dependabot.yml'
- 'doc/**'

jobs:
build-and-test-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate Tag
shell: bash
id: tags
run: |
commit_sha=${{ github.event.after }}
tag=main-${commit_sha:0:7}
echo "tag=${tag}" >> $GITHUB_OUTPUT
- name: Build Controller
shell: bash
env:
IMG: "quay.io/opendatahub/odh-model-controller:${{ steps.tags.outputs.tag }}"
run: make IMG=${IMG} docker-build
- name: Start Kind Cluster
uses: helm/kind-action@v1.8.0
with:
config: ./test/config/kind-e2e-config.yaml
cluster_name: e2e-kind-cluster
- name: Load Local Registry Test Image
env:
IMG: "quay.io/opendatahub/odh-model-controller:${{ steps.tags.outputs.tag }}"
run: |
kind load docker-image -n e2e-kind-cluster ${IMG}
- name: Deploy Controller With Test Image
env:
IMG: "quay.io/opendatahub/odh-model-controller:${{ steps.tags.outputs.tag }}"
run: |
echo "Deploying controller from odh-model-controller branch ${BRANCH}"
make IMG=${IMG} deploy-e2e
- name: Run e2e Tests
timeout-minutes: 20
run: |
echo "Running e2e Test for odh-model-controller"
make e2e-test
14 changes: 14 additions & 0 deletions test/config/kind-e2e-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 31090
hostPort: 31090
listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0"
protocol: tcp # Optional, defaults to tcp
- containerPort: 31080
hostPort: 31080
listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0"
protocol: tcp # Optional, defaults to tcp
- role: worker

0 comments on commit b159cd4

Please sign in to comment.