From c513f14cff5171246dc27c606135ad644582af65 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:28:24 +0100 Subject: [PATCH] ci: adding logs to console --- .ci/collect_mapdl_logs_locals.sh | 4 ++-- .github/workflows/ci.yml | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.ci/collect_mapdl_logs_locals.sh b/.ci/collect_mapdl_logs_locals.sh index b6f6bf7116..5b4eff1c4a 100755 --- a/.ci/collect_mapdl_logs_locals.sh +++ b/.ci/collect_mapdl_logs_locals.sh @@ -2,8 +2,8 @@ mkdir "$LOG_NAMES" && echo "Successfully generated directory $LOG_NAMES" cp *.log ./"$LOG_NAMES"/ || echo "No log files could be found" -cp apdl.out ./"$LOG_NAMES"/ || echo "No APDL log files could be found" -cp pymapdl.apdl ./"$LOG_NAMES"/ || echo "No PYMAPDL APDL log files could be found" +cp *apdl.out ./"$LOG_NAMES"/ || echo "No APDL log files could be found" +cp *pymapdl.apdl ./"$LOG_NAMES"/ || echo "No PYMAPDL APDL log files could be found" ls -la ./"$LOG_NAMES" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d8771d41d..7392bd416c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1001,6 +1001,27 @@ jobs: ${{ env.PYTEST_ARGUMENTS }} \ --cov-report=xml:${{ matrix.mapdl-version }}-minimal-console.xml + - name: "Collect logs on failure" + if: always() + env: + LOG_NAMES: logs-minimal-console-${{ matrix.mapdl-version }} + run: | + .ci/collect_mapdl_logs_locals.sh + + - name: "Upload logs to GitHub" + if: always() + uses: actions/upload-artifact@master + with: + name: logs-minimal-console-${{ matrix.mapdl-version }}.tgz + path: ./logs-minimal-console-${{ matrix.mapdl-version }}.tgz + + - name: "Display files structure" + if: always() + env: + LOG_NAMES: logs-minimal-console-${{ matrix.mapdl-version }} + run: | + .ci/display_logs_locals.sh + - uses: codecov/codecov-action@v5 name: "Upload coverage to Codecov" with: