Skip to content

Commit d155589

Browse files
authored
Add missing config to enable code coverage integration (#2222)
1 parent 9719c8c commit d155589

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed

.github/workflows/cloud-tests.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,27 @@ jobs:
2525
steps:
2626
- name: allowed message
2727
run: echo "Allowed to run"
28+
- name: check Github action bot comment
29+
if: github.event_name == 'pull_request'
30+
uses: peter-evans/find-comment@v3
31+
id: find-bot-comment
32+
with:
33+
issue-number: ${{ github.event.pull_request.number }}
34+
comment-author: github-actions[bot]
35+
body-includes: 'https://app.codecov.io/github/mongodb/mongodb-atlas-kubernetes/commit'
36+
- name: edit comment if exists
37+
if: github.event_name == 'pull_request' && steps.find-bot-comment.outputs.comment-id != ''
38+
uses: peter-evans/create-or-update-comment@v4
39+
with:
40+
edit-mode: replace
41+
comment-id: ${{ steps.find-bot-comment.outputs.comment-id }}
42+
body: https://app.codecov.io/github/mongodb/mongodb-atlas-kubernetes/commit/${{ github.event.pull_request.head.sha }}
43+
- name: comment PR
44+
if: github.event_name == 'pull_request' && steps.find-bot-comment.outputs.comment-id == ''
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: |
48+
gh pr comment ${{ github.event.pull_request.number }} -R mongodb/mongodb-atlas-kubernetes -b "https://app.codecov.io/github/mongodb/mongodb-atlas-kubernetes/commit/${{ github.event.pull_request.head.sha }}"
2849
2950
int-tests:
3051
needs: allowed

.github/workflows/test-e2e-gov.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
if: ${{ success() }}
5656
uses: codecov/codecov-action@v5
5757
with:
58-
files: test/e2e/coverprofile.out
5958
name: ${{ matrix.test }}
59+
token: ${{ secrets.CODECOV_TOKEN }}
60+
files: test/e2e/coverprofile.out
6061
verbose: true

.github/workflows/test-e2e.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ jobs:
280280
if: ${{ success() }}
281281
uses: codecov/codecov-action@v5
282282
with:
283-
files: test/e2e/coverprofile.out
284283
name: ${{ matrix.test }}
284+
token: ${{ secrets.CODECOV_TOKEN }}
285+
files: test/e2e/coverprofile.out
285286
verbose: true

.github/workflows/test-int.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
uses: codecov/codecov-action@v5
5858
with:
5959
name: ${{ matrix.test }}
60+
token: ${{ secrets.CODECOV_TOKEN }}
6061
files: ${{ matrix.path }}/coverprofile.out
6162
verbose: true
6263

.github/workflows/test-unit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ jobs:
2828
uses: codecov/codecov-action@v5
2929
with:
3030
name: unit-tests
31+
token: ${{ secrets.CODECOV_TOKEN }}
3132
files: coverage.out
3233
verbose: true

0 commit comments

Comments
 (0)