Skip to content
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

Merged
merged 3 commits into from
Feb 5, 2024

Conversation

oliverklee
Copy link
Contributor

This makes the CI configuration easier to understand.

Copy link
Contributor

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to rebase this so that I can check it properly...

I'm looking for no overall change of behaviour for this commit, after which it will be clearer what is being changed in the CI jobs, when they are changed.

@JakeQZ JakeQZ force-pushed the task/coverage-separate branch from 54aaec8 to 6d96d8e Compare February 3, 2024 01:27
Copy link
Contributor

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was an educational review. I understand now how the matrix works with include, but haven't quite got to grips with the with parameter. I don't understand what uses it and how. Maybe best keep those in for now.

I think you've added PHP 7.4 to the unit tests as well as code coverage, and would prefer to keep this PR to a refactoring only (with no overall change). I think a command line argument for code-coverage can now be dropped from the original unit tests section.

The number of CI tests should remain the same.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
php-version: ${{ matrix.php-version }}
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none
Copy link
Contributor

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?

Copy link
Contributor Author

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.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@oliverklee oliverklee force-pushed the task/coverage-separate branch 2 times, most recently from 345f50d to 171ea94 Compare February 3, 2024 09:51
@oliverklee
Copy link
Contributor Author

I have now restructured things a bit, moved the coverage generation to a separate workflow, and undone the cleanup/refactoring to keep the changes more clear.

@oliverklee oliverklee requested a review from JakeQZ February 3, 2024 09:52
@oliverklee oliverklee changed the title [TASK] Move the coverage generation to a separate CI job [TASK] Move the coverage generation to a separate CI workflow Feb 3, 2024
@oliverklee oliverklee force-pushed the task/coverage-separate branch from 171ea94 to 42501d3 Compare February 3, 2024 21:09
Copy link
Contributor

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the separation with a new workflow file. Much cleaner and more maintainable - hopefully.

A couple of gremlins still need removing from the original ci.yml.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@oliverklee oliverklee force-pushed the task/coverage-separate branch 2 times, most recently from d561a48 to 5b0705c Compare February 4, 2024 09:26
@oliverklee oliverklee requested a review from JakeQZ February 4, 2024 09:27
Copy link
Contributor

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we lose the coverage: none from the original ci.yml? I don't think it's needed any more.

@JakeQZ
Copy link
Contributor

JakeQZ commented Feb 5, 2024

Also, we are now not getting a 'Code coverage' on push, it seems.

on:
push:
branches:
- master
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the indentation wrong here? Something seems to preventing a match.

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The 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 pull_request checks rather than the push checks. I'll approve and hopefully will see some checks run on 'push' from the merge.

Oh, I've just realized why the code coverage wasn't run - you're pushing to the task/coverage-separate branch, not master - it's only supposed to run on pushes to master. D'oh, sorry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI should have run for the pull_request trigger, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI should have run for the pull_request trigger, though.

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.

@oliverklee oliverklee force-pushed the task/coverage-separate branch from 5b0705c to 39390bb Compare February 5, 2024 09:11
@oliverklee oliverklee requested a review from JakeQZ February 5, 2024 09:13
@JakeQZ JakeQZ merged commit 83ccf6e into master Feb 5, 2024
13 checks passed
@JakeQZ JakeQZ deleted the task/coverage-separate branch February 5, 2024 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants