diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 05f84969..df72f5b4 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -198,14 +198,21 @@ jobs: kubectl get all --all-namespaces kubectl describe pod - - name: Dump Kubernetes Logs - uses: dashanji/kubernetes-log-export-action@v6 - with: - output_dir: ./output + - name: Collect logs from all containers + if: always() && steps.helm_install.outcome != 'skipped' + run: | + mkdir -p logs + for pod in $(kubectl get pods --all-namespaces -o jsonpath='{.items[*].metadata.name}'); do + namespace=$(kubectl get pod $pod --all-namespaces -o jsonpath='{.items[*].metadata.namespace}') + kubectl logs $pod -n $namespace > logs/${namespace}_${pod}.log + done - - name: Run Stoat Action - uses: stoat-dev/stoat-action@v0 - if: always() + - name: Upload logs as artifact + if: always() && steps.helm_install.outcome != 'skipped' + uses: actions/upload-artifact@v3 + with: + name: k8s-logs + path: logs - name: Run helm test id: helm_test