Skip to content

Add workflow to run PHPUnit tests#24

Merged
dkotter merged 6 commits intodevelopfrom
fix/14
Oct 18, 2023
Merged

Add workflow to run PHPUnit tests#24
dkotter merged 6 commits intodevelopfrom
fix/14

Conversation

@dkotter
Copy link
Copy Markdown
Collaborator

@dkotter dkotter commented Oct 18, 2023

Description of the Change

Adds a workflow to run PHPUnit tests on any PR that has changed PHP files.

Note that though the issue this is linked to also mentions adding in an E2E workflow, we currently don't have any E2E tests so I think that should be handled separately.

This Action does the following:

  • Runs anytime a PR is opened against develop or code is pushed to develop or trunk
  • Only runs if PHP files have been changed
  • Sets up PHP version 7.4 (our minimum), runs composer install, installs the WordPress test suite and then runs our PHPUnit tests

Closes #14

How to test the Change

Can see a commit with no PHP changes here: https://github.com/10up/block-catalog/pull/24/checks?sha=3288c66c43ade07171f602bb740db23c6fff9a44

Can see a commit that breaks one of our functions and the unit test fails: https://github.com/10up/block-catalog/pull/24/checks?sha=76522f33c2c1351bc3789f9228831be5b6dc4965

Changelog Entry

Added - GitHub Action workflow to run PHPUnit tests on all needed PRs.

Credits

Props @dkotter

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@dkotter dkotter added this to the 1.5.1 milestone Oct 18, 2023
@dkotter dkotter self-assigned this Oct 18, 2023
@dkotter dkotter marked this pull request as ready for review October 18, 2023 19:11
@dkotter dkotter requested review from a team, dsawardekar and jeffpaul as code owners October 18, 2023 19:11
Copy link
Copy Markdown
Member

@jeffpaul jeffpaul left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for getting this added in!

@dkotter dkotter merged commit 929f626 into develop Oct 18, 2023
@dkotter dkotter deleted the fix/14 branch October 18, 2023 19:42
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.

Add/GitHub action - Testing (PHPUnit & e2e/Cypress)

2 participants