@@ -81,18 +81,25 @@ jobs:
8181 - name : Run unit tests
8282 run : hatch run test:unit-cov-retry
8383
84- # On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch.
84+ # On PR: posts coverage comment (directly on same-repo PRs; via artifact for fork PRs) . On push to main: stores coverage baseline on data branch.
8585 - name : Store unit tests coverage
86+ id : coverage_comment
8687 if : matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule'
8788 uses : py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40
8889 with :
8990 GITHUB_TOKEN : ${{ github.token }}
9091 COVERAGE_PATH : integrations/azure_doc_intelligence
9192 SUBPROJECT_ID : azure_doc_intelligence
92- COMMENT_ARTIFACT_NAME : coverage-comment-azure_doc_intelligence
9393 MINIMUM_GREEN : 90
9494 MINIMUM_ORANGE : 60
9595
96+ - name : Upload coverage comment to be posted
97+ if : matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name == 'pull_request' && steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
98+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
99+ with :
100+ name : coverage-comment-azure_doc_intelligence
101+ path : python-coverage-comment-action-azure_doc_intelligence.txt
102+
96103 - name : Run integration tests
97104 run : hatch run test:integration-cov-append-retry
98105
@@ -103,7 +110,6 @@ jobs:
103110 GITHUB_TOKEN : ${{ github.token }}
104111 COVERAGE_PATH : integrations/azure_doc_intelligence
105112 SUBPROJECT_ID : azure_doc_intelligence-combined
106- COMMENT_ARTIFACT_NAME : coverage-comment-azure_doc_intelligence-combined
107113 MINIMUM_GREEN : 90
108114 MINIMUM_ORANGE : 60
109115
0 commit comments