Skip to content

Commit 1cf1299

Browse files
committed
Upload code coverage info to codecov
So we can start checking for changes in PRs, add a badge and other niceties. Note that, surely once we have the integration with codecov fully working, we can safely remove the current phpunit-coverage-check completely.
1 parent a505a2d commit 1cf1299

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/phpcs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,34 @@ jobs:
6161
6262
# So, there isn't any failure any more (exit without error)
6363
vendor/bin/phpcs --standard=moodle moodle/Tests/fixtures/integration_test_ci.php | tee output.txt && [[ $? = 0 ]]
64+
coverage:
65+
if: github.repository == 'moodlehq/moodle-cs'
66+
name: Code coverage (codecov)
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- name: Check out repository code
71+
uses: actions/checkout@v3
72+
73+
- name: Setup PHP 8.2
74+
uses: shivammathur/setup-php@v2
75+
with:
76+
php-version: 8.2
77+
ini-values: pcov.directory=moodle, error_reporting=-1, display_errors=On
78+
coverage: pcov
79+
tools: composer
80+
81+
- name: Install composer dependencies
82+
run: |
83+
composer install
84+
85+
- name: Run phpunit
86+
if: ${{ always() }}
87+
run: |
88+
./vendor/bin/phpunit --coverage-clover clover.xml
89+
90+
- name: Upload coverage
91+
uses: codecov/codecov-action@v3
92+
with:
93+
files: clover.xml
94+
verbose: true

0 commit comments

Comments
 (0)