Skip to content

test-dispatch-with-artifacts #4

test-dispatch-with-artifacts

test-dispatch-with-artifacts #4

Workflow file for this run

---
name: "Detailed Integration Tests"
on:
repository_dispatch:
types: [dispatch-with-artifacts, test-dispatch-with-artifacts]
jobs:
build:
name: Build Step Details
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-go@v3
with:
go-version: '^1.20.3'
- name: Display Go version
run: go version
- name: Checkout code
uses: actions/checkout@v2
- name: Build k8s-toolbox with details
run: |
echo "=== Build Details ==="
echo "Timestamp: $(date -Iseconds)"
echo "Go version: $(go version)"
echo "Working directory: $(pwd)"
echo "Repository: $GITHUB_REPOSITORY"
echo "Commit SHA: $GITHUB_SHA"
echo ""
echo "=== Building k8s-toolbox ==="
go build -v .
echo ""
echo "=== Binary details ==="
ls -la ktbx
file ktbx
./ktbx version || echo "Version command not available"
echo ""
echo "=== Installing binary ==="
go install .
echo "Build completed successfully"
kind_install:
name: Kind Installation Details
runs-on: ubuntu-22.04
needs: build
steps:
- uses: actions/setup-go@v3
with:
go-version: '^1.20.3'
- name: Checkout code
uses: actions/checkout@v2
- name: Install k8s-toolbox
run: go install .
- name: Install kind with details
run: |
echo "=== Kind Installation Details ==="
echo "Timestamp: $(date -Iseconds)"
echo "System info:"
uname -a
echo "Available disk space:"
df -h
echo "Memory info:"
free -h
echo ""
echo "=== Installing kind ==="
ktbx install kind
echo ""
echo "=== Kind installation verification ==="
which kind
kind version
echo "Kind installation completed successfully"
cluster_create:
name: Cluster Creation Details
runs-on: ubuntu-22.04
needs: kind_install
steps:
- uses: actions/setup-go@v3
with:
go-version: '^1.20.3'
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: |
go install .
ktbx install kind
ktbx install helm
- name: Create cluster with details
run: |
echo "=== Cluster Creation Details ==="
echo "Timestamp: $(date -Iseconds)"
echo "Docker info:"
docker version
docker info | grep -E "(CPUs|Memory|Storage)"
echo ""
echo "=== Creating single-node cluster ==="
ktbx create --single
echo ""
echo "=== Cluster creation verification ==="
kind get clusters
kubectl cluster-info
kubectl config current-context
echo "Cluster creation completed successfully"
verify_pods:
name: Pod Verification Details
runs-on: ubuntu-22.04
needs: cluster_create
steps:
- uses: actions/setup-go@v3
with:
go-version: '^1.20.3'
- name: Checkout code
uses: actions/checkout@v2
- name: Setup cluster
run: |
go install .
ktbx install kind
ktbx install helm
ktbx create --single
- name: Verify pods with details
run: |
echo "=== Pod Verification Details ==="
echo "Timestamp: $(date -Iseconds)"
echo ""
echo "=== All pods across all namespaces ==="
kubectl get pods --all-namespaces -o wide
echo ""
echo "=== Kube-system pods detailed view ==="
kubectl get pods -n kube-system -o yaml
echo ""
echo "=== Pod status summary ==="
echo "Total pods:"
kubectl get pods --all-namespaces --no-headers | wc -l
echo "Running pods:"
kubectl get pods --all-namespaces --no-headers | grep Running | wc -l
echo "Pending pods:"
kubectl get pods --all-namespaces --no-headers | grep Pending | wc -l
echo "Failed pods:"
kubectl get pods --all-namespaces --no-headers | grep -E "(Failed|Error|CrashLoopBackOff)" | wc -l
echo ""
echo "=== Events related to pods ==="
kubectl get events --all-namespaces --sort-by=.metadata.creationTimestamp
echo "Pod verification completed successfully"
verify_nodes:
name: Node Verification Details
runs-on: ubuntu-22.04
needs: cluster_create
steps:
- uses: actions/setup-go@v3
with:
go-version: '^1.20.3'
- name: Checkout code
uses: actions/checkout@v2
- name: Setup cluster
run: |
go install .
ktbx install kind
ktbx install helm
ktbx create --single
- name: Verify nodes with details
run: |
echo "=== Node Verification Details ==="
echo "Timestamp: $(date -Iseconds)"
echo ""
echo "=== Node overview ==="
kubectl get nodes -o wide
echo ""
echo "=== Node detailed information ==="
kubectl describe nodes
echo ""
echo "=== Node capacity and allocatable resources ==="
kubectl get nodes -o json | jq -r '.items[] | {name: .metadata.name, capacity: .status.capacity, allocatable: .status.allocatable}'
echo ""
echo "=== Node conditions ==="
kubectl get nodes -o json | jq -r '.items[] | {name: .metadata.name, conditions: [.status.conditions[] | {type: .type, status: .status, reason: .reason}]}'
echo ""
echo "=== System info from nodes ==="
kubectl get nodes -o json | jq -r '.items[] | {name: .metadata.name, nodeInfo: .status.nodeInfo}'
echo ""
echo "=== Resource usage (if metrics-server available) ==="
kubectl top nodes || echo "metrics-server not available"
echo "Node verification completed successfully"
summary:
name: Test Summary
runs-on: ubuntu-22.04
needs: [build, kind_install, cluster_create, verify_pods, verify_nodes]
if: always()
steps:
- name: Display test results summary
run: |
echo "=== Detailed Integration Test Summary ==="
echo "Timestamp: $(date -Iseconds)"
echo ""
echo "📋 Test Steps Results:"
echo " build: ${{ needs.build.result }} ($(date -Iseconds))"
echo " kind_install: ${{ needs.kind_install.result }} ($(date -Iseconds))"
echo " cluster_create: ${{ needs.cluster_create.result }} ($(date -Iseconds))"
echo " verify_pods: ${{ needs.verify_pods.result }} ($(date -Iseconds))"
echo " verify_nodes: ${{ needs.verify_nodes.result }} ($(date -Iseconds))"
echo ""
echo "=== Overall Status ==="
if [[ "${{ needs.build.result }}" == "success" && "${{ needs.kind_install.result }}" == "success" && "${{ needs.cluster_create.result }}" == "success" && "${{ needs.verify_pods.result }}" == "success" && "${{ needs.verify_nodes.result }}" == "success" ]]; then
echo "✅ All tests passed successfully"
exit 0
else
echo "❌ Some tests failed"
exit 1
fi