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

Add workflow to run PHPUnit tests #24

Merged
merged 6 commits into from
Oct 18, 2023
Merged

Add workflow to run PHPUnit tests #24

merged 6 commits into from
Oct 18, 2023

Conversation

dkotter
Copy link
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 jeffpaul, dsawardekar and a team as code owners October 18, 2023 19:11
Copy link
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
2 checks passed
@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