Skip to content

Commit fadab6c

Browse files
[TASK] Stabilize coverage reporting in CI
1 parent a3549dd commit fadab6c

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

.github/workflows/tests.yaml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
- main
66
- 'renovate/**'
77
pull_request:
8-
branches:
9-
- '**'
10-
- '!renovate/**'
118

129
jobs:
1310
tests:
@@ -36,7 +33,6 @@ jobs:
3633
uses: ramsey/composer-install@v2
3734
with:
3835
dependency-versions: ${{ matrix.dependencies }}
39-
composer-options: ${{ matrix.composer-options }}
4036

4137
# Run tests
4238
- name: Run tests
@@ -68,21 +64,49 @@ jobs:
6864
- name: Run tests with coverage
6965
run: composer test:coverage
7066

71-
# Report coverage
67+
# Upload artifact
7268
- name: Fix coverage path
7369
working-directory: .build/coverage
7470
run: sed -i 's#/home/runner/work/cpanel-requests/cpanel-requests#${{ github.workspace }}#g' clover.xml
71+
- name: Upload coverage artifact
72+
uses: actions/upload-artifact@v3
73+
with:
74+
name: coverage
75+
path: .build/coverage/clover.xml
76+
retention-days: 7
77+
78+
coverage-report:
79+
name: Report test coverage
80+
runs-on: ubuntu-latest
81+
needs: coverage
82+
steps:
83+
- uses: actions/checkout@v4
84+
with:
85+
fetch-depth: 0
86+
87+
# Download artifact
88+
- name: Download coverage artifact
89+
id: download
90+
uses: actions/download-artifact@v3
91+
with:
92+
name: coverage
93+
94+
# CodeClimate
7595
- name: CodeClimate report
7696
uses: paambaati/[email protected]
97+
if: env.CC_TEST_REPORTER_ID
7798
env:
7899
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
79100
with:
80101
coverageLocations: |
81-
${{ github.workspace }}/.build/coverage/clover.xml:clover
102+
${{ steps.download.outputs.download-path }}/clover.xml:clover
103+
104+
# codecov
82105
- name: codecov report
83106
uses: codecov/codecov-action@v3
84107
with:
85108
token: ${{ secrets.CODECOV_TOKEN }}
86-
directory: .build/coverage
109+
files: |
110+
${{ steps.download.outputs.download-path }}/clover.xml
87111
fail_ci_if_error: true
88112
verbose: true

0 commit comments

Comments
 (0)