From 7155bcc8403a7daeb40c81d661f2b8432ce49de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Wed, 30 Oct 2024 10:34:42 -0700 Subject: [PATCH 01/19] Check optional value on fail --- .github/workflows/cicd.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 977bb53a0..ab8d5306f 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -235,7 +235,12 @@ jobs: tox run -e lint --notest - name: Run unit tests - run: tox run -e ${TOX_ENV} + run: + if ! tox run -e ${TOX_ENV}; then + status=$? + echo "${{ matrix.optional }}" + exit ${status} + fi; env: IMS_TEST_MYSQL_HOST: localhost IMS_TEST_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }} From 0312aed1f18b59d5f38e0bf80dd44e5133e892de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Wed, 30 Oct 2024 10:40:36 -0700 Subject: [PATCH 02/19] Need some pipe --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index ab8d5306f..aa822d5c8 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -235,7 +235,7 @@ jobs: tox run -e lint --notest - name: Run unit tests - run: + run: | if ! tox run -e ${TOX_ENV}; then status=$? echo "${{ matrix.optional }}" From 973321f0831ba7a49dfc05b018f58b28dc3d2e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Wed, 30 Oct 2024 10:43:16 -0700 Subject: [PATCH 03/19] Try to emit a warning --- .github/workflows/cicd.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index aa822d5c8..f43fda589 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -238,7 +238,9 @@ jobs: run: | if ! tox run -e ${TOX_ENV}; then status=$? - echo "${{ matrix.optional }}" + if [ "${{ matrix.optional }}" == "true" ]; then + echo "::warning::Optional matrix job failed."; + fi; exit ${status} fi; env: From 711dad4bd3053007ed0be0b51bcbcd0ab6faa7b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Wed, 30 Oct 2024 11:17:16 -0700 Subject: [PATCH 04/19] Add step summary --- .github/workflows/cicd.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index f43fda589..df8a77eb8 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -239,7 +239,11 @@ jobs: if ! tox run -e ${TOX_ENV}; then status=$? if [ "${{ matrix.optional }}" == "true" ]; then - echo "::warning::Optional matrix job failed."; + echo "::warning::Optional matrix job failed." + echo "optional_fail=true" >> "${GITHUB_OUTPUT}" + echo "### Optional matrix job Py:${{ matrix.python-version }} - ${{ matrix.os }} failed" >> "${GITHUB_STEP_SUMMARY}" + echo " - tox-prefix: ${{ matrix.tox-prefix }}" + echo " - exit status: "${status}" >> "${GITHUB_STEP_SUMMARY}" fi; exit ${status} fi; From f3b8dcaa3184c1fa4a6eacdc64d8c29aeaeeac7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Wed, 30 Oct 2024 11:19:00 -0700 Subject: [PATCH 05/19] stray " --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index df8a77eb8..6e4c4e851 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -243,7 +243,7 @@ jobs: echo "optional_fail=true" >> "${GITHUB_OUTPUT}" echo "### Optional matrix job Py:${{ matrix.python-version }} - ${{ matrix.os }} failed" >> "${GITHUB_STEP_SUMMARY}" echo " - tox-prefix: ${{ matrix.tox-prefix }}" - echo " - exit status: "${status}" >> "${GITHUB_STEP_SUMMARY}" + echo " - exit status: ${status}" >> "${GITHUB_STEP_SUMMARY}" fi; exit ${status} fi; From ef5b4b0f87eb28336ea4b73a8d3f325cae87bcbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Wed, 30 Oct 2024 11:27:53 -0700 Subject: [PATCH 06/19] optional fail should still save trail log --- .github/workflows/cicd.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 6e4c4e851..9d3190ff4 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -235,6 +235,7 @@ jobs: tox run -e lint --notest - name: Run unit tests + id: test run: | if ! tox run -e ${TOX_ENV}; then status=$? @@ -255,7 +256,7 @@ jobs: IMS_TEST_MYSQL_PASSWORD: ims - name: Upload Trial log artifact - if: ${{ failure() }} + if: ${{ failure() || steps.test.outputs.optional_fail == "true" }} uses: actions/upload-artifact@v4 with: name: trial From 7376dea249c6589b213a4ba8fc46b79fe20b5ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Wed, 30 Oct 2024 18:34:25 -0700 Subject: [PATCH 07/19] =?UTF-8?q?"=20=E2=9E=9C=20'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 9d3190ff4..dcc25dc32 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -256,7 +256,7 @@ jobs: IMS_TEST_MYSQL_PASSWORD: ims - name: Upload Trial log artifact - if: ${{ failure() || steps.test.outputs.optional_fail == "true" }} + if: ${{ failure() || steps.test.outputs.optional_fail == 'true' }} uses: actions/upload-artifact@v4 with: name: trial From 4b5f9070699a6b97b474c3a97fce464725b29276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Wed, 30 Oct 2024 18:41:44 -0700 Subject: [PATCH 08/19] Missed redirect --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index dcc25dc32..4c90525af 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -243,7 +243,7 @@ jobs: echo "::warning::Optional matrix job failed." echo "optional_fail=true" >> "${GITHUB_OUTPUT}" echo "### Optional matrix job Py:${{ matrix.python-version }} - ${{ matrix.os }} failed" >> "${GITHUB_STEP_SUMMARY}" - echo " - tox-prefix: ${{ matrix.tox-prefix }}" + echo " - tox-prefix: ${{ matrix.tox-prefix }}" >> "${GITHUB_STEP_SUMMARY}" echo " - exit status: ${status}" >> "${GITHUB_STEP_SUMMARY}" fi; exit ${status} From bced6980a54a24c3edf4ea50c188c3a3d3766cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Wed, 30 Oct 2024 18:58:06 -0700 Subject: [PATCH 09/19] Try adding a comment --- .github/workflows/cicd.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 4c90525af..895670b61 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -262,6 +262,13 @@ jobs: name: trial path: .tox/${TOX_ENV}/log/trial.log + - name: Add comment if optional job failed + if: {{ steps.test.outputs.optional_fail == 'true' }} + uses: thollander/actions-comment-pull-request@v3 + with: + comment_tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" + filePath: "${GITHUB_STEP_SUMMARY}" + # Use the latest supported Python version for combining coverage to # prevent parsing errors in older versions when looking at modern code. - uses: "actions/setup-python@v5" From 320a82c246d6eb8dceac0c75c5e4b6aa7d29ad00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Wed, 30 Oct 2024 19:22:35 -0700 Subject: [PATCH 10/19] Someone needs to reinstall the pre-commit hook --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 895670b61..f9c72f098 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -263,7 +263,7 @@ jobs: path: .tox/${TOX_ENV}/log/trial.log - name: Add comment if optional job failed - if: {{ steps.test.outputs.optional_fail == 'true' }} + if: ${{ steps.test.outputs.optional_fail == 'true' }} uses: thollander/actions-comment-pull-request@v3 with: comment_tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" From fbad1bb097abc874f69ca38ebd0b950520985c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Wed, 30 Oct 2024 19:33:43 -0700 Subject: [PATCH 11/19] =?UTF-8?q?Looks=20like=20input=20names=20changed=20?= =?UTF-8?q?over=20time=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cicd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index f9c72f098..985f1022b 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -266,8 +266,8 @@ jobs: if: ${{ steps.test.outputs.optional_fail == 'true' }} uses: thollander/actions-comment-pull-request@v3 with: - comment_tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" - filePath: "${GITHUB_STEP_SUMMARY}" + comment-tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" + file-path: "${GITHUB_STEP_SUMMARY}" # Use the latest supported Python version for combining coverage to # prevent parsing errors in older versions when looking at modern code. From ec051685d76468cb74254021c36cc2852b4eaec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 31 Oct 2024 09:27:30 -0700 Subject: [PATCH 12/19] Use message arg --- .github/workflows/cicd.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 985f1022b..1a54919ff 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -242,9 +242,7 @@ jobs: if [ "${{ matrix.optional }}" == "true" ]; then echo "::warning::Optional matrix job failed." echo "optional_fail=true" >> "${GITHUB_OUTPUT}" - echo "### Optional matrix job Py:${{ matrix.python-version }} - ${{ matrix.os }} failed" >> "${GITHUB_STEP_SUMMARY}" - echo " - tox-prefix: ${{ matrix.tox-prefix }}" >> "${GITHUB_STEP_SUMMARY}" - echo " - exit status: ${status}" >> "${GITHUB_STEP_SUMMARY}" + echo "optional_fail_status=${status}" >> "${GITHUB_OUTPUT}" fi; exit ${status} fi; @@ -267,7 +265,10 @@ jobs: uses: thollander/actions-comment-pull-request@v3 with: comment-tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" - file-path: "${GITHUB_STEP_SUMMARY}" + message: | + ### Optional matrix job Py:${{ matrix.python-version }} - ${{ matrix.os }} failed + - tox prefix: ${{ matrix.tox-prefix }} + - exit status: ${{ steps.test.outputs.optional_fail_status }} # Use the latest supported Python version for combining coverage to # prevent parsing errors in older versions when looking at modern code. From eb7e5f1771dea6ea4c989cca7b53722cb2b375fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 31 Oct 2024 09:41:15 -0700 Subject: [PATCH 13/19] clean up sh a bit --- .github/workflows/cicd.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 1a54919ff..012f5c357 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -237,15 +237,14 @@ jobs: - name: Run unit tests id: test run: | - if ! tox run -e ${TOX_ENV}; then - status=$? - if [ "${{ matrix.optional }}" == "true" ]; then - echo "::warning::Optional matrix job failed." - echo "optional_fail=true" >> "${GITHUB_OUTPUT}" - echo "optional_fail_status=${status}" >> "${GITHUB_OUTPUT}" - fi; - exit ${status} + status=0 + tox run -e "${TOX_ENV}" || status=$? + if [ ! ${status} && "${{ matrix.optional }}" == "true" ]; then + echo "::warning::Optional matrix job failed." + echo "optional_fail=true" >> "${GITHUB_OUTPUT}" + echo "optional_fail_status=${status}" >> "${GITHUB_OUTPUT}" fi; + exit ${status} env: IMS_TEST_MYSQL_HOST: localhost IMS_TEST_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }} @@ -266,7 +265,7 @@ jobs: with: comment-tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" message: | - ### Optional matrix job Py:${{ matrix.python-version }} - ${{ matrix.os }} failed + ### Optional matrix job Py:${{ matrix.python-version }} - ${{ matrix.os }} failed! - tox prefix: ${{ matrix.tox-prefix }} - exit status: ${{ steps.test.outputs.optional_fail_status }} From 4403e1066cfc2831775a8425cdf5165be4372dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 31 Oct 2024 09:46:10 -0700 Subject: [PATCH 14/19] Fix conditional --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 012f5c357..d42b20f94 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -239,7 +239,7 @@ jobs: run: | status=0 tox run -e "${TOX_ENV}" || status=$? - if [ ! ${status} && "${{ matrix.optional }}" == "true" ]; then + if [ ${status} -ne 0 ] && [ "${{ matrix.optional }}" == "true" ]; then echo "::warning::Optional matrix job failed." echo "optional_fail=true" >> "${GITHUB_OUTPUT}" echo "optional_fail_status=${status}" >> "${GITHUB_OUTPUT}" From d7e2ecc8d5e6943d484818c84bb8d4801a41cb61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 31 Oct 2024 09:51:47 -0700 Subject: [PATCH 15/19] Fix conditionals --- .github/workflows/cicd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index d42b20f94..5a95f1692 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -253,14 +253,14 @@ jobs: IMS_TEST_MYSQL_PASSWORD: ims - name: Upload Trial log artifact - if: ${{ failure() || steps.test.outputs.optional_fail == 'true' }} + if: ${{ failure() }} uses: actions/upload-artifact@v4 with: name: trial path: .tox/${TOX_ENV}/log/trial.log - name: Add comment if optional job failed - if: ${{ steps.test.outputs.optional_fail == 'true' }} + if: ${{ failure() && steps.test.outputs.optional_fail == 'true' }} uses: thollander/actions-comment-pull-request@v3 with: comment-tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" From 7d8d79f0456fe8d3f0fdb0b3cf30cf573543abf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 31 Oct 2024 09:57:28 -0700 Subject: [PATCH 16/19] try delete --- .github/workflows/cicd.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 5a95f1692..8c1881d3d 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -253,21 +253,26 @@ jobs: IMS_TEST_MYSQL_PASSWORD: ims - name: Upload Trial log artifact - if: ${{ failure() }} uses: actions/upload-artifact@v4 with: name: trial path: .tox/${TOX_ENV}/log/trial.log - - name: Add comment if optional job failed - if: ${{ failure() && steps.test.outputs.optional_fail == 'true' }} + - name: Clear prior optional job failed comment, if any uses: thollander/actions-comment-pull-request@v3 with: comment-tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" - message: | - ### Optional matrix job Py:${{ matrix.python-version }} - ${{ matrix.os }} failed! - - tox prefix: ${{ matrix.tox-prefix }} - - exit status: ${{ steps.test.outputs.optional_fail_status }} + mode: delete + + # - name: Add comment if optional job failed + # if: ${{ failure() && steps.test.outputs.optional_fail == 'true' }} + # uses: thollander/actions-comment-pull-request@v3 + # with: + # comment-tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" + # message: | + # ### Optional matrix job Py:${{ matrix.python-version }} - ${{ matrix.os }} failed! + # - tox prefix: ${{ matrix.tox-prefix }} + # - exit status: ${{ steps.test.outputs.optional_fail_status }} # Use the latest supported Python version for combining coverage to # prevent parsing errors in older versions when looking at modern code. From 5d2886732e87be42e70fe145c62fe32f44a5c492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 31 Oct 2024 10:16:24 -0700 Subject: [PATCH 17/19] Forgot we still have to exit 0 on optional fail --- .github/workflows/cicd.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 8c1881d3d..1afb9222d 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -243,6 +243,7 @@ jobs: echo "::warning::Optional matrix job failed." echo "optional_fail=true" >> "${GITHUB_OUTPUT}" echo "optional_fail_status=${status}" >> "${GITHUB_OUTPUT}" + exit 0 # Ignore error here to keep the green checkmark going fi; exit ${status} env: @@ -253,19 +254,21 @@ jobs: IMS_TEST_MYSQL_PASSWORD: ims - name: Upload Trial log artifact + if: ${{ failure() || steps.test.outputs.optional_fail == 'true' }} uses: actions/upload-artifact@v4 with: name: trial path: .tox/${TOX_ENV}/log/trial.log - name: Clear prior optional job failed comment, if any + if: ${{ steps.test.outputs.optional_fail == 'true' }} uses: thollander/actions-comment-pull-request@v3 with: comment-tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" mode: delete # - name: Add comment if optional job failed - # if: ${{ failure() && steps.test.outputs.optional_fail == 'true' }} + # if: ${{ steps.test.outputs.optional_fail == 'true' }} # uses: thollander/actions-comment-pull-request@v3 # with: # comment-tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" From 96e954afe4b5c128e4d86f80e973cd1ba2a292df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 31 Oct 2024 10:17:01 -0700 Subject: [PATCH 18/19] Remove condition --- .github/workflows/cicd.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 1afb9222d..544ad8c4c 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -261,7 +261,6 @@ jobs: path: .tox/${TOX_ENV}/log/trial.log - name: Clear prior optional job failed comment, if any - if: ${{ steps.test.outputs.optional_fail == 'true' }} uses: thollander/actions-comment-pull-request@v3 with: comment-tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" From 4bf3a5ae648aa0dae9ec826e8ceb7ba37a225fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Thu, 31 Oct 2024 10:35:32 -0700 Subject: [PATCH 19/19] Combine steps --- .github/workflows/cicd.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 544ad8c4c..3dfd9c0f7 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -260,21 +260,17 @@ jobs: name: trial path: .tox/${TOX_ENV}/log/trial.log - - name: Clear prior optional job failed comment, if any + - name: Add comment if optional job failed; delete otherwise + if: ${{ matrix.optional }} uses: thollander/actions-comment-pull-request@v3 with: + # Note: tag must be unique to each matrix case comment-tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" - mode: delete - - # - name: Add comment if optional job failed - # if: ${{ steps.test.outputs.optional_fail == 'true' }} - # uses: thollander/actions-comment-pull-request@v3 - # with: - # comment-tag: "${{ matrix.python-version }}-${{ matrix.os }}-optional-notice" - # message: | - # ### Optional matrix job Py:${{ matrix.python-version }} - ${{ matrix.os }} failed! - # - tox prefix: ${{ matrix.tox-prefix }} - # - exit status: ${{ steps.test.outputs.optional_fail_status }} + message: | + ### ⚠️ Optional matrix job Py:${{ matrix.python-version }} - ${{ matrix.os }} failed ⚠️ + - tox prefix: ${{ matrix.tox-prefix }} + - exit status: ${{ steps.test.outputs.optional_fail_status }} + mode: ${{ steps.test.outputs.optional_fail == 'true' && 'upsert' || 'delete' }} # Use the latest supported Python version for combining coverage to # prevent parsing errors in older versions when looking at modern code.