Watcher E2E #20
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: Watcher E2E | |
on: | |
schedule: | |
- cron: '20 7 * * 1-5' | |
jobs: | |
watcher-integration: | |
strategy: | |
matrix: | |
cli-stability: [ "unstable" ] | |
name: "Run Watcher E2E tests" | |
runs-on: docker-in-docker | |
container: docker:cli | |
env: | |
K3D_VERSION: v5.4.7 | |
ISTIO_VERSION: 1.17.1 | |
steps: | |
- name: Install prerequisites | |
run: apk update && apk upgrade && apk --no-cache add git curl wget make bash musl-dev go | |
- name: Set up k3d | |
run: wget -qO - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=$K3D_VERSION bash | |
- name: Provision SKR cluster | |
run: | | |
k3d cluster create skr --agents 2 \ | |
--k3s-arg '--disable=traefik@server:0' | |
- name: Provision KCP cluster | |
run: | | |
k3d cluster create kcp --agents 4 \ | |
-p 9443:443@loadbalancer -p 9080:80@loadbalancer \ | |
--registry-create k3d-kyma-registry.localhost:5111 \ | |
--k3s-arg '--disable=traefik@server:0' | |
- name: Update Kubeconfigs | |
run: k3d kubeconfig merge -a -d | |
- name: Update /etc/hosts | |
run: | | |
FILE=/etc/hosts | |
if [ -f "$FILE" ]; then | |
echo "127.0.0.1 k3d-kyma-registry" >> $FILE | |
else | |
echo "$FILE does not exist." | |
exit 1 | |
fi | |
echo "/etc/hosts file patched" | |
- name: Export required Kubeconfig Env vars | |
run: | | |
echo "KCP_KUBECONFIG=$(k3d kubeconfig write kcp)" >> $GITHUB_ENV | |
echo "SKR_KUBECONFIG=$(k3d kubeconfig write skr)" >> $GITHUB_ENV | |
- name: checkout repo | |
uses: actions/[email protected] | |
- name: Install kubectl | |
run: | | |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | |
chmod +x kubectl | |
mv kubectl /usr/local/bin | |
- name: Switch kubeconfig context to KCP cluster | |
run: kubectl config use-context k3d-kcp | |
- name: Install Istio | |
run: | | |
curl -L https://istio.io/downloadIstio | TARGET_ARCH=x86_64 sh - | |
chmod +x istio-$ISTIO_VERSION/bin/istioctl | |
mv istio-$ISTIO_VERSION/bin/istioctl /usr/local/bin | |
istioctl install -y | |
- name: Install Cert Manager | |
run: | | |
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.yaml | |
kubectl wait --for=jsonpath='{.status.phase}'=Running pod --all -n cert-manager --timeout=90s | |
- name: build and push LM to local registry | |
run: | | |
make docker-build IMG=k3d-kyma-registry.localhost:5111/lifecycle-manager:0.0.1 && \ | |
make docker-push IMG=k3d-kyma-registry.localhost:5111/lifecycle-manager:0.0.1 | |
- name: Set up Go for ${{ github.repository }} | |
run: | | |
export GOPATH=$(go env GOPATH) && \ | |
echo "GOPATH=$GOPATH" >> $GITHUB_ENV && \ | |
mkdir -p ${GOPATH}/src ${GOPATH}/bin | |
- name: Deploy LM local testing kustomize | |
run: | | |
if make local-deploy-with-watcher IMG=k3d-kyma-registry.localhost:5111/lifecycle-manager:0.0.1; then | |
echo "KLM deployed successfully" | |
else | |
echo "Deploy encountered some error, will retry after 30 seconds" | |
sleep 30 | |
make local-deploy-with-watcher IMG=k3d-kyma-registry.localhost:5111/lifecycle-manager:0.0.1 | |
fi | |
- name: Export DinD ENV var | |
run: echo "DIND=true" >> $GITHUB_ENV | |
- name: Run Watcher E2E Tests | |
run: | | |
make -C tests/e2e_test test-watcher-e2e |