From 7988a35feb03237be65a172d1a8030f00ea58663 Mon Sep 17 00:00:00 2001 From: "Douglas Cerna (Soy Douglas)" Date: Fri, 3 May 2024 17:27:44 +0200 Subject: [PATCH] Download installation logs on failure --- .../archivematica-acceptance-tests.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/archivematica-acceptance-tests.yml b/.github/workflows/archivematica-acceptance-tests.yml index 8945b3c0..9d8d5dec 100644 --- a/.github/workflows/archivematica-acceptance-tests.yml +++ b/.github/workflows/archivematica-acceptance-tests.yml @@ -121,6 +121,25 @@ jobs: -u ubuntu \ -e "archivematica_src_am_version=${{ env.am_version }} archivematica_src_ss_version=${{ env.ss_version }}" \ -vvv + - name: "Save logs" + if: "${{ failure() }}" + working-directory: "${{ github.workspace }}/tests/archivematica-acceptance-tests" + run: | + mkdir /tmp/logs + podman-compose exec --user root archivematica cp -r /var/log /tmp/logs + podman-compose exec --user root archivematica cp -r /etc /tmp/logs + podman-compose exec --user root archivematica cp -r /usr/lib/systemd /tmp/logs + podman-compose exec --user root archivematica journalctl --no-pager > /tmp/logs/journalctl.log + podman-compose exec --user root archivematica chown -R ubuntu:ubuntu /tmp/logs + podman cp archivematica-acceptance-test_archivematica_1:/tmp/logs/ /tmp/logs + sudo chown -R $USER /tmp/logs + tar -czf /tmp/logs.tar.gz /tmp/logs + - name: "Upload logs on failure" + if: "${{ failure() }}" + uses: "actions/upload-artifact@v4" + with: + name: "logs-${{ matrix.docker_image.label }}-${{ matrix.feature }}" + path: "/tmp/logs.tar.gz" - name: "Prepare the container for running the AMAUATs" working-directory: "${{ github.workspace }}/tests/archivematica-acceptance-tests" run: |