From eb3813a74a4d9421f8a465859d6e9e26924541d3 Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Tue, 9 Jul 2024 11:50:28 +0200 Subject: [PATCH 1/4] Use full environment name in artifact name Github needs unique artifact names since v4 of the action. --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a1184b57a..e53a7d8e4 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -47,7 +47,7 @@ jobs: if: failure() uses: actions/upload-artifact@v4 with: - name: pytest-mpl-results + name: pytest-mpl-results-${{ matrix.test-env }}-${{ matrix.container }} path: /tmp/oggm-mpl-results/ - name: Upload Coverage if: ${{ !contains(matrix.container, 'py3') }} From e51593a361223117471bab3bd31590383e65be0c Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Tue, 9 Jul 2024 15:53:41 +0200 Subject: [PATCH 2/4] Sanitze artifact name --- .github/workflows/run-tests.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e53a7d8e4..5483ca01c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -43,11 +43,20 @@ jobs: run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: Test run: ./ci/run_tests.sh "${{ matrix.test-env }}" "${{ matrix.container }}" + - name: Normalize Artifact Name + id: sanitize-name + if: failure() + run: | + SANITIZED_NAME="pytest-mpl-results-${{ matrix.test-env }}-${{ matrix.container }}" + SANITIZED_NAME="${SANITIZED_NAME/:/_}" + SANITIZED_NAME="${SANITIZED_NAME/\//_}" + SANITIZED_NAME="${SANITIZED_NAME/./_}" + echo "sanitized_name=${SANITIZED_NAME}" >> $GITHUB_OUTPUT - name: Upload pytest-mpl artifacts if: failure() uses: actions/upload-artifact@v4 with: - name: pytest-mpl-results-${{ matrix.test-env }}-${{ matrix.container }} + name: "${{ steps.sanitize-name.outputs.sanitized_name }}" path: /tmp/oggm-mpl-results/ - name: Upload Coverage if: ${{ !contains(matrix.container, 'py3') }} From 96ff027b0699b7e4fa8937be2d7270ed3993609c Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Tue, 9 Jul 2024 15:55:24 +0200 Subject: [PATCH 3/4] Use proper replace-action --- .github/workflows/run-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5483ca01c..7842aebda 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -48,9 +48,9 @@ jobs: if: failure() run: | SANITIZED_NAME="pytest-mpl-results-${{ matrix.test-env }}-${{ matrix.container }}" - SANITIZED_NAME="${SANITIZED_NAME/:/_}" - SANITIZED_NAME="${SANITIZED_NAME/\//_}" - SANITIZED_NAME="${SANITIZED_NAME/./_}" + SANITIZED_NAME="${SANITIZED_NAME//:/_}" + SANITIZED_NAME="${SANITIZED_NAME//\//_}" + SANITIZED_NAME="${SANITIZED_NAME//./_}" echo "sanitized_name=${SANITIZED_NAME}" >> $GITHUB_OUTPUT - name: Upload pytest-mpl artifacts if: failure() From f79a93d1f4d5e78d24c357e3d7d78cab452ec505 Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Tue, 9 Jul 2024 16:24:51 +0200 Subject: [PATCH 4/4] Run substitutions in bash --- .github/workflows/run-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7842aebda..f3bab8e54 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -46,6 +46,7 @@ jobs: - name: Normalize Artifact Name id: sanitize-name if: failure() + shell: bash run: | SANITIZED_NAME="pytest-mpl-results-${{ matrix.test-env }}-${{ matrix.container }}" SANITIZED_NAME="${SANITIZED_NAME//:/_}"