Skip to content

Commit ee6e203

Browse files
authored
ci: post coverage comments on PRs from forks (#3123)
1 parent efc4342 commit ee6e203

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+478
-156
lines changed

.github/workflows/aimlapi.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,25 @@ jobs:
8484
- name: Run unit tests
8585
run: hatch run test:unit-cov-retry
8686

87-
# On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch.
87+
# 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.
8888
- name: Store unit tests coverage
89+
id: coverage_comment
8990
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule'
9091
uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40
9192
with:
9293
GITHUB_TOKEN: ${{ github.token }}
9394
COVERAGE_PATH: integrations/aimlapi
9495
SUBPROJECT_ID: aimlapi
95-
COMMENT_ARTIFACT_NAME: coverage-comment-aimlapi
9696
MINIMUM_GREEN: 90
9797
MINIMUM_ORANGE: 60
9898

99+
- name: Upload coverage comment to be posted
100+
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name == 'pull_request' && steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
101+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
102+
with:
103+
name: coverage-comment-aimlapi
104+
path: python-coverage-comment-action-aimlapi.txt
105+
99106
- name: Run integration tests
100107
run: hatch run test:integration-cov-append-retry
101108

@@ -106,7 +113,6 @@ jobs:
106113
GITHUB_TOKEN: ${{ github.token }}
107114
COVERAGE_PATH: integrations/aimlapi
108115
SUBPROJECT_ID: aimlapi-combined
109-
COMMENT_ARTIFACT_NAME: coverage-comment-aimlapi-combined
110116
MINIMUM_GREEN: 90
111117
MINIMUM_ORANGE: 60
112118

.github/workflows/amazon_bedrock.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,25 @@ jobs:
9494
- name: Run unit tests
9595
run: hatch run test:unit-cov-retry
9696

97-
# On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch.
97+
# 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.
9898
- name: Store unit tests coverage
99+
id: coverage_comment
99100
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule'
100101
uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40
101102
with:
102103
GITHUB_TOKEN: ${{ github.token }}
103104
COVERAGE_PATH: integrations/amazon_bedrock
104105
SUBPROJECT_ID: amazon_bedrock
105-
COMMENT_ARTIFACT_NAME: coverage-comment-amazon_bedrock
106106
MINIMUM_GREEN: 90
107107
MINIMUM_ORANGE: 60
108108

109+
- name: Upload coverage comment to be posted
110+
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name == 'pull_request' && steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
111+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
112+
with:
113+
name: coverage-comment-amazon_bedrock
114+
path: python-coverage-comment-action-amazon_bedrock.txt
115+
109116
# Do not authenticate on PRs from forks and on PRs created by dependabot
110117
- name: AWS authentication
111118
id: aws-auth
@@ -126,7 +133,6 @@ jobs:
126133
GITHUB_TOKEN: ${{ github.token }}
127134
COVERAGE_PATH: integrations/amazon_bedrock
128135
SUBPROJECT_ID: amazon_bedrock-combined
129-
COMMENT_ARTIFACT_NAME: coverage-comment-amazon_bedrock-combined
130136
MINIMUM_GREEN: 90
131137
MINIMUM_ORANGE: 60
132138

.github/workflows/amazon_sagemaker.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,25 @@ jobs:
8383
- name: Run unit tests
8484
run: hatch run test:unit-cov-retry
8585

86-
# On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch.
86+
# 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.
8787
- name: Store unit tests coverage
88+
id: coverage_comment
8889
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule'
8990
uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40
9091
with:
9192
GITHUB_TOKEN: ${{ github.token }}
9293
COVERAGE_PATH: integrations/amazon_sagemaker
9394
SUBPROJECT_ID: amazon_sagemaker
94-
COMMENT_ARTIFACT_NAME: coverage-comment-amazon_sagemaker
9595
MINIMUM_GREEN: 90
9696
MINIMUM_ORANGE: 60
9797

98+
- name: Upload coverage comment to be posted
99+
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name == 'pull_request' && steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
100+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
101+
with:
102+
name: coverage-comment-amazon_sagemaker
103+
path: python-coverage-comment-action-amazon_sagemaker.txt
104+
98105
- name: Run integration tests
99106
run: hatch run test:integration-cov-append-retry
100107

@@ -105,7 +112,6 @@ jobs:
105112
GITHUB_TOKEN: ${{ github.token }}
106113
COVERAGE_PATH: integrations/amazon_sagemaker
107114
SUBPROJECT_ID: amazon_sagemaker-combined
108-
COMMENT_ARTIFACT_NAME: coverage-comment-amazon_sagemaker-combined
109115
MINIMUM_GREEN: 90
110116
MINIMUM_ORANGE: 60
111117

.github/workflows/anthropic.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,25 @@ jobs:
8484
- name: Run unit tests
8585
run: hatch run test:unit-cov-retry
8686

87-
# On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch.
87+
# 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.
8888
- name: Store unit tests coverage
89+
id: coverage_comment
8990
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule'
9091
uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40
9192
with:
9293
GITHUB_TOKEN: ${{ github.token }}
9394
COVERAGE_PATH: integrations/anthropic
9495
SUBPROJECT_ID: anthropic
95-
COMMENT_ARTIFACT_NAME: coverage-comment-anthropic
9696
MINIMUM_GREEN: 90
9797
MINIMUM_ORANGE: 60
9898

99+
- name: Upload coverage comment to be posted
100+
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name == 'pull_request' && steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
101+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
102+
with:
103+
name: coverage-comment-anthropic
104+
path: python-coverage-comment-action-anthropic.txt
105+
99106
- name: Run integration tests
100107
run: hatch run test:integration-cov-append-retry
101108

@@ -106,7 +113,6 @@ jobs:
106113
GITHUB_TOKEN: ${{ github.token }}
107114
COVERAGE_PATH: integrations/anthropic
108115
SUBPROJECT_ID: anthropic-combined
109-
COMMENT_ARTIFACT_NAME: coverage-comment-anthropic-combined
110116
MINIMUM_GREEN: 90
111117
MINIMUM_ORANGE: 60
112118

.github/workflows/arcadedb.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,25 @@ jobs:
8989
- name: Run unit tests
9090
run: hatch run test:unit-cov-retry
9191

92-
# On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch.
92+
# 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.
9393
- name: Store unit tests coverage
94+
id: coverage_comment
9495
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule'
9596
uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40
9697
with:
9798
GITHUB_TOKEN: ${{ github.token }}
9899
COVERAGE_PATH: integrations/arcadedb
99100
SUBPROJECT_ID: arcadedb
100-
COMMENT_ARTIFACT_NAME: coverage-comment-arcadedb
101101
MINIMUM_GREEN: 90
102102
MINIMUM_ORANGE: 60
103103

104+
- name: Upload coverage comment to be posted
105+
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name == 'pull_request' && steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
106+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
107+
with:
108+
name: coverage-comment-arcadedb
109+
path: python-coverage-comment-action-arcadedb.txt
110+
104111
- name: Run integration tests
105112
run: hatch run test:integration-cov-append-retry
106113

@@ -111,7 +118,6 @@ jobs:
111118
GITHUB_TOKEN: ${{ github.token }}
112119
COVERAGE_PATH: integrations/arcadedb
113120
SUBPROJECT_ID: arcadedb-combined
114-
COMMENT_ARTIFACT_NAME: coverage-comment-arcadedb-combined
115121
MINIMUM_GREEN: 90
116122
MINIMUM_ORANGE: 60
117123

.github/workflows/astra.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,25 @@ jobs:
8484
- name: Run unit tests
8585
run: hatch run test:unit-cov-retry
8686

87-
# On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch.
87+
# 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.
8888
- name: Store unit tests coverage
89+
id: coverage_comment
8990
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule'
9091
uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40
9192
with:
9293
GITHUB_TOKEN: ${{ github.token }}
9394
COVERAGE_PATH: integrations/astra
9495
SUBPROJECT_ID: astra
95-
COMMENT_ARTIFACT_NAME: coverage-comment-astra
9696
MINIMUM_GREEN: 90
9797
MINIMUM_ORANGE: 60
9898

99+
- name: Upload coverage comment to be posted
100+
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name == 'pull_request' && steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
101+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
102+
with:
103+
name: coverage-comment-astra
104+
path: python-coverage-comment-action-astra.txt
105+
99106
- name: Run integration tests
100107
env:
101108
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }}
@@ -109,7 +116,6 @@ jobs:
109116
GITHUB_TOKEN: ${{ github.token }}
110117
COVERAGE_PATH: integrations/astra
111118
SUBPROJECT_ID: astra-combined
112-
COMMENT_ARTIFACT_NAME: coverage-comment-astra-combined
113119
MINIMUM_GREEN: 90
114120
MINIMUM_ORANGE: 60
115121

.github/workflows/azure_ai_search.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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_ai_search
9192
SUBPROJECT_ID: azure_ai_search
92-
COMMENT_ARTIFACT_NAME: coverage-comment-azure_ai_search
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_ai_search
101+
path: python-coverage-comment-action-azure_ai_search.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_ai_search
105112
SUBPROJECT_ID: azure_ai_search-combined
106-
COMMENT_ARTIFACT_NAME: coverage-comment-azure_ai_search-combined
107113
MINIMUM_GREEN: 90
108114
MINIMUM_ORANGE: 60
109115

.github/workflows/azure_doc_intelligence.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

.github/workflows/chroma.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,25 @@ jobs:
8787
- name: Run unit tests
8888
run: hatch run test:unit-cov-retry
8989

90-
# On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch.
90+
# 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.
9191
- name: Store unit tests coverage
92+
id: coverage_comment
9293
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule'
9394
uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40
9495
with:
9596
GITHUB_TOKEN: ${{ github.token }}
9697
COVERAGE_PATH: integrations/chroma
9798
SUBPROJECT_ID: chroma
98-
COMMENT_ARTIFACT_NAME: coverage-comment-chroma
9999
MINIMUM_GREEN: 90
100100
MINIMUM_ORANGE: 60
101101

102+
- name: Upload coverage comment to be posted
103+
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name == 'pull_request' && steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
104+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
105+
with:
106+
name: coverage-comment-chroma
107+
path: python-coverage-comment-action-chroma.txt
108+
102109
- name: Run integration tests
103110
run: hatch run test:integration-cov-append-retry
104111

@@ -109,7 +116,6 @@ jobs:
109116
GITHUB_TOKEN: ${{ github.token }}
110117
COVERAGE_PATH: integrations/chroma
111118
SUBPROJECT_ID: chroma-combined
112-
COMMENT_ARTIFACT_NAME: coverage-comment-chroma-combined
113119
MINIMUM_GREEN: 90
114120
MINIMUM_ORANGE: 60
115121

.github/workflows/cohere.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,25 @@ jobs:
8484
- name: Run unit tests
8585
run: hatch run test:unit-cov-retry
8686

87-
# On PR: generates coverage comment artifact. On push to main: stores coverage baseline on data branch.
87+
# 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.
8888
- name: Store unit tests coverage
89+
id: coverage_comment
8990
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name != 'schedule'
9091
uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3.40
9192
with:
9293
GITHUB_TOKEN: ${{ github.token }}
9394
COVERAGE_PATH: integrations/cohere
9495
SUBPROJECT_ID: cohere
95-
COMMENT_ARTIFACT_NAME: coverage-comment-cohere
9696
MINIMUM_GREEN: 90
9797
MINIMUM_ORANGE: 60
9898

99+
- name: Upload coverage comment to be posted
100+
if: matrix.python-version == '3.10' && runner.os == 'Linux' && github.event_name == 'pull_request' && steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
101+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
102+
with:
103+
name: coverage-comment-cohere
104+
path: python-coverage-comment-action-cohere.txt
105+
99106
- name: Run integration tests
100107
run: hatch run test:integration-cov-append-retry
101108

@@ -106,7 +113,6 @@ jobs:
106113
GITHUB_TOKEN: ${{ github.token }}
107114
COVERAGE_PATH: integrations/cohere
108115
SUBPROJECT_ID: cohere-combined
109-
COMMENT_ARTIFACT_NAME: coverage-comment-cohere-combined
110116
MINIMUM_GREEN: 90
111117
MINIMUM_ORANGE: 60
112118

0 commit comments

Comments
 (0)