Files
helm-actions/.gitea/workflows/e2e.yml
2026-03-18 21:54:05 +00:00

59 lines
2.0 KiB
YAML

on: pull_request
jobs:
k8s-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Docker CLI, kind, and kubectl
run: |
# Install Docker CLI (to talk to the host daemon via the mounted socket)
apt-get update && apt-get install -y docker.io jq
# Install kind
curl -Lo /usr/local/bin/kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-linux-amd64
chmod +x /usr/local/bin/kind
# Install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
install kubectl /usr/local/bin/
- name: Create kind cluster
run: |
kind create cluster --name test-cluster-2
- name: Attach kind control-plane to job network and wait
run: |
apt-get update && apt-get install -y jq docker.io
JOB_CONTAINER_ID="$(hostname)"
NETWORK_NAME="$(docker inspect "$JOB_CONTAINER_ID" --format '{{range $k, $v := .NetworkSettings.Networks}}{{$k}}{{end}}')"
echo "Job network: $NETWORK_NAME"
CONTROL_PLANE="test-cluster-2-control-plane"
docker network connect "$NETWORK_NAME" "$CONTROL_PLANE" || true
KIND_IP="$(docker inspect "$CONTROL_PLANE" --format "{{(index .NetworkSettings.Networks \"$NETWORK_NAME\").IPAddress}}")"
echo "Kind IP: $KIND_IP"
# Point kubectl at the control-plane directly
kubectl config set-cluster kind-test-cluster-2 --server="https://${KIND_IP}:6443"
kubectl config set-cluster kind-test-cluster-2 --insecure-skip-tls-verify=true
# Wait for API and nodes
for i in $(seq 1 120); do
if kubectl get nodes >/dev/null 2>&1; then
break
fi
echo "Waiting for kind API... ($i/120)"
sleep 2
done
kubectl get nodes
- name: Verify cluster access
run: |
kubectl cluster-info
kubectl get nodes
kubectl get pods -A