From c9c6ccb20a2985101e546fa2717b83cd115923a4 Mon Sep 17 00:00:00 2001 From: Tamara Date: Tue, 24 Dec 2024 10:58:36 +0100 Subject: [PATCH] Add logs to artifacts --- .github/workflows/e2e-test.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index c1c48dd3..e2deafce 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -65,16 +65,25 @@ jobs: with: name: html-report path: test-report - - name: Copy Logs from Container + + - name: Copy Adyen logs if available if: always() run: | # Create a local directory for logs mkdir -p logs - # Copy logs from Shopware container to the host - docker cp shopware6:~/html/var/log/adyen/api.log logs + # Check if the log file exists in the container + if docker exec shopware6 test -f /var/www/html/var/log/adyen/api.log; then + echo "Log file exists. Copying..." + docker cp shopware6:/var/www/html/var/log/adyen/api.log logs + else + echo "Log file does not exist. Skipping copy." + # Create an empty file to avoid upload step failing + touch logs/api.log + fi + shell: bash - - name: Upload Adyen api Logs + - name: Upload Adyen API Logs if: always() uses: actions/upload-artifact@v3 with: