File tree Expand file tree Collapse file tree 4 files changed +68
-3
lines changed Expand file tree Collapse file tree 4 files changed +68
-3
lines changed Original file line number Diff line number Diff line change 8
8
description : " enabled uploading coverage report to codecov"
9
9
required : false
10
10
default : false
11
+ collect-code-coverage :
12
+ type : boolean
13
+ description : " enables collecting coverage reports and uploading them as artifacts"
14
+ required : false
15
+ default : false
11
16
secrets :
12
17
CODECOV_TOKEN :
13
18
description : " token to upload codecov report"
50
55
run-on : ubuntu-latest
51
56
task : linuxAllTest
52
57
upload-code-coverage : ${{ inputs.upload-code-coverage }}
58
+ collect-code-coverage : ${{ inputs.collect-code-coverage }}
53
59
secrets :
54
60
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
55
61
check-macos :
Original file line number Diff line number Diff line change 16
16
description : " enabled uploading coverage report to codecov"
17
17
required : false
18
18
default : false
19
+ collect-code-coverage :
20
+ type : boolean
21
+ description : " enables collecting coverage reports and uploading them as artifacts"
22
+ required : false
23
+ default : false
19
24
secrets :
20
25
CODECOV_TOKEN :
21
26
description : " token to upload codecov report"
66
71
uses : codecov/codecov-action@v4
67
72
with :
68
73
token : ${{ secrets.CODECOV_TOKEN }}
74
+ - name : Collect coverage reports
75
+ if : inputs.collect-code-coverage && github.actor != 'dependabot[bot]'
76
+ uses : actions/upload-artifact@v4
77
+ with :
78
+ name : coverage-reports
79
+ path : ' **/build/reports/kover/report.xml'
Original file line number Diff line number Diff line change
1
+ name : Upload code coverage results
2
+
3
+ on :
4
+ workflow_run :
5
+ workflows : ['Check the PR']
6
+ types : [completed]
7
+
8
+ jobs :
9
+ upload :
10
+ runs-on : ubuntu-latest
11
+ if : github.event.workflow_run.actor.name != 'dependabot[bot]'
12
+ steps :
13
+ - name : ' Checkout Repository'
14
+ uses : actions/checkout@v4
15
+ with :
16
+ ref : ${{ github.event.workflow_run.head_branch }}
17
+ - name : Download benchmark results
18
+ uses : actions/download-artifact@v4
19
+ with :
20
+ name : coverage-reports
21
+ path : reports/
22
+ run-id : ${{ github.event.workflow_run.id }}
23
+ - name : Download PR number
24
+ uses : actions/download-artifact@v4
25
+ with :
26
+ name : pr-number
27
+ path : ' .'
28
+ run-id : ${{ github.event.workflow_run.id }}
29
+ - id : trigger
30
+ run : echo "pr-number=$(cat pr_number)" >> GITHUB_OUTPUT
31
+ - name : Test pull_requests objects
32
+ run : echo ${{ github.event.workflow_run.pull_requests }}
33
+ - name : Upload coverage reports to Codecov
34
+ uses : codecov/codecov-action@v4
35
+ with :
36
+ override_pr : ${{ steps.trigger.outputs.pr-number }}
37
+ token : ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change 53
53
check-pr :
54
54
uses : ./.github/workflows/build-and-test.yml
55
55
with :
56
- upload-code-coverage : true
57
- secrets :
58
- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
56
+ collect-code-coverage : true
59
57
danger-check :
60
58
runs-on : ubuntu-latest
61
59
permissions :
71
69
dangerfile : Dangerfile.df.kts
72
70
env :
73
71
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
72
+ store-pr-number :
73
+ runs-on : ubuntu-latest
74
+ steps :
75
+ - name : Save PR number
76
+ env :
77
+ PR_NUMBER : ${{ github.event.number }}
78
+ run : |
79
+ mkdir -p ./pr
80
+ echo $PR_NUMBER > ./pr/pr_number
81
+ - uses : actions/upload-artifact@v4
82
+ with :
83
+ name : pr-number
84
+ path : pr/
74
85
You can’t perform that action at this time.
0 commit comments