PoC for Kubernetes provisioning support (via OLM) #61
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: Kubernetes E2E Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- 'ide-config/**' | |
- '**.md' | |
concurrency: | |
# Only run once for latest commit per ref and cancel other (previous) runs. | |
group: ci-e2e-intersmash-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
minikube: | |
name: K8S | |
runs-on: ubuntu-latest | |
if: github.repository == 'Intersmash/intersmash' | |
strategy: | |
fail-fast: false | |
matrix: | |
kubernetes: [v1.31.0, v1.30.0] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Start Minikube | |
run: minikube start | |
# - name: Setup Minikube | |
# uses: manusa/[email protected] | |
# with: | |
# driver: docker | |
# container runtime: containerd | |
# minikube version: 'v1.32.0' | |
# kubernetes version: ${{ matrix.kubernetes }} | |
# github token: ${{ secrets.GITHUB_TOKEN }} | |
# start args: "--memory='4gb' --cpus='2'" | |
# - name: Enable minikube registry | |
# run: | | |
# minikube addons enable registry | |
# kubectl port-forward --namespace kube-system service/registry 5000:80 & | |
# kubectl config view | |
- name: Install operator-sdk | |
run: | | |
set -x | |
# | |
# operator-sdk must be installed manually, see | |
# | |
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac) | |
export OS=$(uname | awk '{print tolower($0)}') | |
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.37.0 | |
curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} | |
chmod +x operator-sdk_${OS}_${ARCH} && sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk | |
operator-sdk olm install | |
kubectl get catalogsource operatorhubio-catalog -o json -n olm | |
- name: Fetch package names from the "olm" namespace | |
run: kubectl get packagemanifest -n olm | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Install and Run Integration Tests | |
run: | | |
# | |
# set the Kubernetes hostname that will resolve to the minikube IP | |
# | |
export KUBERNETES_HOSTNAME=host.minikube.internal | |
# | |
# run... | |
# | |
mkdir local-repo | |
# pre-fetch dependencies | |
mvn clean install --batch-mode -Dmaven.repo.local=./local-repo -DskipTests | |
# run K8s integration tests | |
mvn test --batch-mode -fae -Dmaven.repo.local=./local-repo -pl testsuite/integration-tests -Pts.k8s \ | |
-Dintersmash.kubernetes.url=https://$(minikube ip):8443 \ | |
-Dintersmash.kubernetes.route_domain=$(minikube ip) \ | |
-Dintersmash.kubernetes.hostname=$KUBERNETES_HOSTNAME \ | |
-Dintersmash.kubernetes.namespace=test-k8s-1 \ | |
-Dintersmash.olm.operators.catalog_source=community-operators \ | |
-Dintersmash.olm.operators.namespace=olm \ | |
-Dintersmash.hyperfoil.operators.catalog_source=operatorhubio-catalog |