Skip to content

Bump the codeql-action group with 3 updates (#249) #222

Bump the codeql-action group with 3 updates (#249)

Bump the codeql-action group with 3 updates (#249) #222

name: Integration Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: ./go.mod
- name: Install kind
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
- 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
sudo mv ./kubectl /usr/local/bin/kubectl
- name: Create kind cluster
run: |
cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: kgrep-integration-test
nodes:
- role: control-plane
image: kindest/node:v1.31.0@sha256:53df588e04085fd41ae12de0c3fe4c72f7013bba32a20e7325357a1ac94ba865
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
EOF
- name: Wait for cluster to be ready
run: |
kubectl wait --for=condition=Ready nodes --all --timeout=300s
kubectl get nodes
- name: Build kgrep binary
run: |
go build -o kgrep ./main.go
- name: Run integration tests
env:
KGREP_INTEGRATION_TESTS: "true"
KUBECONFIG: /home/runner/.kube/config
run: |
kind export kubeconfig --name kgrep-integration-test
kubectl cluster-info
kubectl get nodes
cd test/integration
go test -v -timeout=10m ./...
- name: Collect debug info on failure
if: failure()
run: |
echo "=== Cluster Info ==="
kubectl cluster-info dump || true
echo "=== Pod Status ==="
kubectl get pods --all-namespaces || true
echo "=== Events ==="
kubectl get events --all-namespaces || true
echo "=== Logs from test namespace ==="
kubectl logs --all-containers=true -n kgrep-integration-test || true
- name: Clean up
if: always()
run: |
kind delete cluster --name kgrep-integration-test || true