-
Notifications
You must be signed in to change notification settings - Fork 64
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
Switch to GitHub Actions #143
Conversation
the hoster should be able to choose between different ways to run the `phpunit-test-runner`
Otherwise the reporting will be skipped if phpunit runs into errors.
@desrosj can you have a look at the latest changes? |
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.
Thanks for running with this, @pfefferle! I haven't looked into the reason why the workflow run is failing, but left some general feedback for the workflows themselves.
.github/workflows/tests.yml
Outdated
steps: | ||
- name: Cancel previous runs of this workflow (pull requests only) | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: styfle/[email protected] |
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.
For 3rd party actions, using version numbers and ranges is OK, but there are some tradeoffs. The Security hardening page in the GHA docs details these.
In Gutenberg and WordPress Core, we have adopted the pattern of using the full length commit SHA followed by an inline # v0.8.0
comment.
thanks @desrosj
@desrosj the test fails, because it is not configured properly. This repo should only be a whitepaper/example for hosters, how they can run the unit-tests with different action or CI/CD services. |
This reverts commit 6080a4e.
This follows the GitHub Actions security best practices when using third-party actions. For more info, see https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions.
GHA will not be the preferred way to run the tests for everyone. This includes a condition to disable it by default.
@pfefferle I've made a handful of updates to polish the workflow. I think it's in a great state. I do think there is one thing we need to discuss before merging. Since the workflow is an example for how hosts can run the tests using GHA, I think it should be disabled by default. I've added a condition in the workflow to never run, and documented that the implementer should remove that if GHA is preferred. |
@desrosj I have problems with the caching of
|
I like the idea! 👍 |
Ah, yes a lock file must be present for the NPM caching to configure correctly. But I'm not sure this can be configured because the |
This is difficult to set up because a `package-lock.json` file is required in order to create a cache key. In this context, the lock file should be the one from WordPress Core. But since WordPress is not checked out until the `prepare.php` step, caching cannot be configured before hand.
Updated! I think this one is looking pretty good! |
works like a charm 👍 |
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.
LGTM!
Thanks a lot @desrosj ! |
Thanks so much @pfefferle and @desrosj !! 🎉🎉🎉 |
This PR adds an example workflow for implementing the test runner using GitHub Actions.