Skip to content

Commit

Permalink
ci: 👷 use kind instead of minikube
Browse files Browse the repository at this point in the history
  • Loading branch information
this-is-tobi committed Jul 21, 2023
1 parent bd3ec3c commit 7e1cdb7
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/test-kube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,32 @@ jobs:
env:
LOCAL_DOMAIN: basegun.kubernetes.local
steps:
- name: Start minikube
uses: medyagh/setup-minikube@latest
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
addons: registry,ingress
cluster_name: basegun-testing
wait: 60s
verbosity: 2

- name: Set up ingress controller
run: |
cat << EOF > values.yml
deployment:
kind: DaemonSet
ingressClass:
enabled: true
isDefaultClass: true
ports:
web:
hostPort: 80
websecure:
hostPort: 443
service:
type: ClusterIP
EOF
helm repo add traefik https://traefik.github.io/charts && helm repo update
helm install --namespace ingress-traefik --create-namespace traefik traefik/traefik -f values.yml
kubectl --namespace ingress-traefik rollout status daemonset traefik --timeout=90s
- name: Set up Helm
uses: azure/setup-helm@v3
Expand All @@ -26,7 +48,7 @@ jobs:
- name: Add hosts to /etc/hosts
run: |
MINIKUBE_IP="$(minikube ip)"
sudo echo "$MINIKUBE_IP $LOCAL_DOMAIN" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 $LOCAL_DOMAIN" | sudo tee -a /etc/hosts
# we are forced to attribute a DNS to kube cluster for it to work properly

- name: Checkout to code
Expand All @@ -35,12 +57,9 @@ jobs:
- name: Build and install basegun with helm, and test if deployment is successful
id: tests
run: |
# use docker env
export SHELL=/bin/bash
eval $(minikube -p minikube docker-env)
TAG=$(make get-current-tag) BUILD_TARGET=test docker-compose -f docker-compose-prod.yml build backend
TAG=$(make get-current-tag) docker-compose -f docker-compose-prod.yml build frontend
kind load docker-image basegun-backend:$(make get-current-tag) basegun-frontend:$(make get-current-tag)
helm upgrade --install basegun ./infra/kube/helm/ \
--set ingress.hosts[0].host="$LOCAL_DOMAIN" \
--set ingress.hosts[0].paths[0].path="/" \
Expand Down Expand Up @@ -81,7 +100,7 @@ jobs:
run: npm ci
working-directory: ./frontend

- name: Test end to end
- name: Test end to end (cypress)
run: FRONTEND_HOST=$LOCAL_DOMAIN FRONTEND_PORT=80 npm run test:e2e-ci
working-directory: ./frontend

Expand Down

0 comments on commit 7e1cdb7

Please sign in to comment.