-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TASK] Move the coverage generation to a separate CI workflow #427
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the indentation wrong here? Something seems to preventing a match. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra spaces should not matter. It looks correct, so IDK why it's not working. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've just rebased and repushed, an the coverage job seems to have run fine for me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't see a problem now, though the checks run this time have been the Oh, I've just realized why the code coverage wasn't run - you're pushing to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The CI should have run for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Strange. When I reviewed last night, it definitely showed 12 succussful checks on 'push', rather than 13 on 'pull_request'. I wouldn't have spotted this potential problem otherwise. |
||
pull_request: | ||
|
||
name: Code coverage | ||
|
||
jobs: | ||
code-coverage: | ||
name: Code coverage | ||
|
||
runs-on: ubuntu-22.04 | ||
|
||
strategy: | ||
matrix: | ||
php-version: [ '7.4' ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
ini-values: error_reporting=E_ALL | ||
tools: composer:v2 | ||
coverage: xdebug | ||
|
||
- name: Show the Composer configuration | ||
run: composer config --global --list | ||
|
||
- name: Cache dependencies installed with composer | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/composer | ||
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: | | ||
php${{ matrix.php-version }}-composer- | ||
|
||
- name: Install Composer dependencies | ||
run: | | ||
composer update --with-dependencies --no-progress; | ||
composer show; | ||
|
||
- name: Run Tests | ||
run: ./vendor/bin/phpunit --coverage-clover build/coverage/xml | ||
|
||
- name: Upload coverage results to Codacy | ||
env: | ||
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
if: "${{ env.CODACY_PROJECT_TOKEN != '' }}" | ||
run: | | ||
./vendor/bin/codacycoverage clover build/coverage/xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What uses this? Is it possible to lose the
coverage: none
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting
coverage: none
has the result of no code coverage tool (like Xdebug of PCOV) getting loaded, which should speed up the non-coverage tasks a bit.