-
Notifications
You must be signed in to change notification settings - Fork 2
chore: DRAFT - Add test to Previews and setup test workflow for plugins #241
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
base: main
Are you sure you want to change the base?
Conversation
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
I think it may be time for some caching optimizations. You can check out how I do this with Node on the Faust repo. Basically, I install & set up Node, install dependencies, then the disk is cached under a unique hash based on the state of Looks like at least composer install, if not some wider PHP config, could be configured to only happen once, and then have PHPCS, tests, and artifact creation all do cache restores. |
Thanks @moonmeister ❤️ Thanks for the great feedback. I will have a look tomorrow at how you setup caching on Faust and look at making some optimizations. |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
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.
Pull Request Overview
This PR introduces test enhancements and refactors the plugin’s configuration while setting up a comprehensive testing and CI/CD workflow for the HWP Previews plugin.
- Refactored the plugin constant definitions to use individual conditional definitions with appropriate PHPCS disable/enable comments.
- Added Docker configuration, updated composer dependencies, and introduced new GitHub Actions workflows and composite actions for Codeception tests, plugin artifact creation, and overall code quality.
Reviewed Changes
Copilot reviewed 70 out of 70 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
plugins/hwp-previews/hwp-previews.php | Refactored constant definitions and added PHPCS disable/enable comments |
plugins/hwp-previews/docker-compose.yml | Introduced Docker environment configuration for testing |
plugins/hwp-previews/composer.json | Updated dev dependencies and composer scripts for testing and build tasks |
plugins/hwp-previews/codeception.dist.yml | Added configuration for Codeception testing environment |
plugins/hwp-previews/README.md | Updated documentation to include testing instructions |
plugins/hwp-previews/ACTIONS_AND_FILTERS.md | Updated developer documentation to reflect new filters |
plugins/hwp-previews/.gitignore | Expanded ignore rules to cover new test directories and generated files |
plugins/hwp-previews/.env.dist | Added environment variable definitions for testing |
plugins/hwp-previews/.docker/ (init-docker.sh, Dockerfile, .env.ci) | Added scripts and Docker setup for seamless testing |
.github/workflows/ (multiple YAML files) | Added/updated GitHub Actions workflow triggers to support PHP-only plugin changes |
.github/actions/ (composite actions) | Introduced composite actions for PHP setup, Codeception tests, and plugin artifact creation |
Comments suppressed due to low confidence (1)
.github/workflows/plugin-artifact-for-pr.yml:6
- The workflow trigger pattern was updated to 'plugins/**.php', which restricts the trigger to PHP files only. Confirm that changes in non-PHP files (e.g. configuration or documentation) do not need to trigger artifact builds.
- 'plugins/**'
@@ -48,25 +48,41 @@ | |||
|
|||
/** | |||
* Define plugin constants. | |||
* | |||
* phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh |
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.
[nitpick] Consider reviewing the need to disable complexity checks in the hwp_previews_constants function; refactoring to reduce complexity could allow re-enabling these rules.
Copilot uses AI. Check for mistakes.
--env SKIP_TESTS_CLEANUP=${{ env.SKIP_TESTS_CLEANUP }} \ | ||
--env SUITES=acceptance \ | ||
$(docker compose ps -q wordpress) \ | ||
bash -c "cd wp-content/plugins/$(basename ${{ inputs.working-directory }}) && bin/run-codeception.sh" |
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.
[nitpick] Consider verifying that using 'basename' on the working directory consistently derives the correct plugin folder, especially when the input path may include a trailing slash.
bash -c "cd wp-content/plugins/$(basename ${{ inputs.working-directory }}) && bin/run-codeception.sh" | |
bash -c "cd wp-content/plugins/$(basename $(echo ${{ inputs.working-directory }} | sed 's:/*$::')) && bin/run-codeception.sh" |
Copilot uses AI. Check for mistakes.
ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
Description
Related Issue
Dependant PRs
Type of Change
How Has This Been Tested?
Screenshots
Checklist