Skip to content

Commit

Permalink
Export Kind logs to ease debugging
Browse files Browse the repository at this point in the history
It also deletes cluster after Oran testing

Signed-off-by: Cédric Ollivier <[email protected]>
  • Loading branch information
collivier authored and martin-mat committed Nov 13, 2024
1 parent 2bcd444 commit 531e9a1
Showing 1 changed file with 50 additions and 8 deletions.
58 changes: 50 additions & 8 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ jobs:
cat /tmp/cluster.yml
export CLUSTER=$(uuidgen)
echo "export CLUSTER=$CLUSTER" > cluster.env
echo kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig ./$CLUSTER.conf
echo kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig ./$CLUSTER.conf --retain
kind --version
kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig ./$CLUSTER.conf
kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig ./$CLUSTER.conf --retain
export KUBECONFIG=$(pwd)/$CLUSTER.conf
kubectl get nodes
- name: Cache crystal shards
Expand Down Expand Up @@ -209,10 +209,17 @@ jobs:
if: ${{ always() }}
run: |
source cluster.env
kind export logs --name $CLUSTER /tmp/output-dir
kind delete cluster --name $CLUSTER
docker container prune -f || true
docker volume prune -f || true
continue-on-error: true
- name: upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: log
path: /tmp/output-dir

chaos:
name: Chaos & Oran Tests
Expand Down Expand Up @@ -258,9 +265,9 @@ jobs:
EOF
export CLUSTER=$(uuidgen)
echo "export CLUSTER=$CLUSTER" > cluster.env
echo kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig ./$CLUSTER.conf
echo kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig ./$CLUSTER.conf --retain
kind --version
kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig ./$CLUSTER.conf
kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig ./$CLUSTER.conf --retain
export KUBECONFIG=$(pwd)/$CLUSTER.conf
kubectl get nodes
Expand Down Expand Up @@ -303,7 +310,21 @@ jobs:
echo "CLUSTER RATE LIMIT: $CLUSTER_RATE_LIMIT"
echo "DOCKER USER RATE LIMIT: $AUTH_RATE_LIMIT"
LOG_LEVEL=info crystal spec --warnings none --tag ${{ matrix.tag }} -v
- name: Delete Cluster
if: ${{ always() }}
run: |
source cluster.env
kind export logs --name $CLUSTER /tmp/output-dir
kind delete cluster --name $CLUSTER
docker container prune -f || true
docker volume prune -f || true
continue-on-error: true
- name: upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: log
path: /tmp/output-dir

build:
name: Build Release
Expand Down Expand Up @@ -386,7 +407,7 @@ jobs:
echo "export CLUSTER=$CLUSTER"
echo "export CLUSTER=$CLUSTER" > cluster.env
kind --version
kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig /tmp/$CLUSTER.conf
kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig /tmp/$CLUSTER.conf --retain
export KUBECONFIG=/tmp/$CLUSTER.conf
kubectl get nodes
- name: Run Test Suite without source(config_lifecycle)
Expand All @@ -408,11 +429,18 @@ jobs:
if: ${{ always() }}
run: |
source cluster.env
kind export logs --name $CLUSTER /tmp/output-dir
kind delete cluster --name $CLUSTER
docker container prune -f || true
docker volume prune -f || true
docker network prune -f || true
continue-on-error: true
- name: upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: log
path: /tmp/output-dir

test_binary_microservice:
name: Test Binary Without Source(microservice)
Expand Down Expand Up @@ -462,7 +490,7 @@ jobs:
export CLUSTER=$(uuidgen)
echo "export CLUSTER=$CLUSTER" > cluster.env
kind --version
kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig /tmp/$CLUSTER.conf
kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig /tmp/$CLUSTER.conf --retain
export KUBECONFIG=/tmp/$CLUSTER.conf
kubectl get nodes
- name: Run Test Suite without source(microservice)
Expand All @@ -483,11 +511,18 @@ jobs:
if: ${{ always() }}
run: |
source cluster.env
kind export logs --name $CLUSTER /tmp/output-dir
kind delete cluster --name $CLUSTER
docker container prune -f || true
docker volume prune -f || true
docker network prune -f || true
continue-on-error: true
- name: upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: log
path: /tmp/output-dir

test_binary_all:
name: Test Binary Without Source(all)
Expand Down Expand Up @@ -537,7 +572,7 @@ jobs:
export CLUSTER=$(uuidgen)
echo "export CLUSTER=$CLUSTER" > cluster.env
kind --version
kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig /tmp/$CLUSTER.conf
kind create cluster --name $CLUSTER --config=/tmp/cluster.yml --kubeconfig /tmp/$CLUSTER.conf --retain
export KUBECONFIG=/tmp/$CLUSTER.conf
kubectl get nodes
- name: Run Test Suite without source(all)
Expand All @@ -558,11 +593,18 @@ jobs:
if: ${{ always() }}
run: |
source cluster.env
kind export logs --name $CLUSTER /tmp/output-dir
kind delete cluster --name $CLUSTER
docker container prune -f || true
docker volume prune -f || true
docker network prune -f || true
continue-on-error: true
- name: upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: log
path: /tmp/output-dir

release:
name: Publish Release
Expand Down

0 comments on commit 531e9a1

Please sign in to comment.