From 8724dbdecb0405fc73d85ea7c14d9c050dd4f43e Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Wed, 18 Oct 2023 13:22:46 -0700 Subject: [PATCH] Add VM log capture on failure Signed-off-by: Derek Nola --- .github/workflows/install.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/install.yaml b/.github/workflows/install.yaml index bb152ebe3ccf..e8519bf4621b 100644 --- a/.github/workflows/install.yaml +++ b/.github/workflows/install.yaml @@ -90,3 +90,15 @@ jobs: run: vagrant provision --provision-with=k3s-status - name: "k3s-procps" run: vagrant provision --provision-with=k3s-procps + - name: On Failure, Debug VM status, capture logs + if: ${{ failure() }} + run: | + vagrant global-status + logsDir=$(vboxmanage list vms --long | grep Logs | awk '{print $3" "$4}') + cp "$logsDir"/VBox.log ./${{ matrix.vm }}.log + - name: On Failure, Upload VM logs + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.vm }}.log + path: ./${{ matrix.vm }}.log \ No newline at end of file