Skip to content

(ci): pre-configuration of e2e testing #45

(ci): pre-configuration of e2e testing

(ci): pre-configuration of e2e testing #45

Workflow file for this run

name: E2E
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: Run the build with upterm debugging enabled
(https://github.com/lhotari/action-upterm/)
required: false
default: false
pull_request:
branches:
- main
concurrency:
group: e2e-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
unit-test:
runs-on: ubuntu-latest
name: Unit Test
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Run Unit Tests
run: go test ./...
e2e-test-empty:
runs-on: ubuntu-latest
name: E2E Empty Test
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install DevSpace
run: |
curl -fsSL -o /tmp/devspace https://github.com/devspace-cloud/devspace/releases/latest/download/devspace-linux-amd64
chmod +x /tmp/devspace
sudo mv /tmp/devspace /usr/local/bin/devspace
- name: Install kubectl, kustomize and clusterctl
run: |
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash && sudo mv kustomize /usr/local/bin/
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.6.1/clusterctl-linux-amd64 -o clusterctl && chmod +x clusterctl && sudo mv clusterctl /usr/local/bin/
- name: Run clusterctl command
run: |
clusterctl config repositories | grep vcluster
- name: Check Kubernetes config file
run: |
cat $HOME/.kube/config
- name: Set Kubernetes context
run: |
kubectl config set-context test-PR --kubeconfig=$HOME/.kube/config
- name: Verify Kubernetes context
run: |
kubectl config get-contexts
# - name: Configure kubectl
# run: |
# kubectl config set-context test-PR
- name: Check Kubernetes connectivity
run: |
echo "=== Kubectl version ==="
kubectl version --client
echo "=== Kubectl config ==="
kubectl config view
echo "=== Kubectl current context ==="
kubectl config current-context
echo "=== Kubectl cluster info ==="
kubectl cluster-info
echo "=== Kubectl get nodes ==="
kubectl get nodes
echo "=== Kubectl get pods ==="
kubectl get pods --all-namespaces
echo "=== Kubectl get namespaces ==="
kubectl get namespaces
echo "=== Test kubectl command ==="
kubectl get all --all-namespaces
- name: Run kubectl get namespaces
run: |
kubectl get namespaces
- name: DevSpace Deploy
run: |
devspace deploy -p deploy