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 GitHub as valid CI for plugin and theme scaffold #331

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

ernilambar
Copy link
Member

@ernilambar ernilambar commented Apr 1, 2024

Fixes #330

  • Add github as valid option for --ci argument
  • Add GitHub Actions file template
  • When scaffolding, test file is copied to .github/workflows/testing.yml

Note:
For theme, in theme-bootstrap.muscatche, there is code for checking PHP version. So test is exited for PHP greater than 8.0. Is this still valid?

if ( PHP_MAJOR_VERSION >= 8 ) {
	echo "The scaffolded tests cannot currently be run on PHP 8.0+. See https://github.com/wp-cli/scaffold-command/issues/285" . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
	exit( 1 );
}

@ernilambar ernilambar changed the title Add GitHub support for plugin and theme scaffold Add GitHub as valid CI for plugin and theme scaffold Apr 1, 2024
@ernilambar ernilambar marked this pull request as ready for review April 1, 2024 07:27
@ernilambar ernilambar requested a review from a team as a code owner April 1, 2024 07:27
@danielbachhuber
Copy link
Member

For theme, in theme-bootstrap.muscatche, there is code for checking PHP version. So test is exited for PHP greater than 8.0. Is this still valid?

Can you test?

@ernilambar
Copy link
Member Author

@danielbachhuber I created sample theme and removed that conditional checks. All tests have run successfully. ernilambar/sample-theme#3

Sample plugin check: https://github.com/ernilambar/sample-plugin/pull/3

@ernilambar
Copy link
Member Author

@danielbachhuber It looks ok for me to remove following code from theme-bootstrap.mustache.


if ( PHP_MAJOR_VERSION >= 8 ) {
	echo "The scaffolded tests cannot currently be run on PHP 8.0+. See https://github.com/wp-cli/scaffold-command/issues/285" . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
	exit( 1 );
}

Should it be done in separate PR?

@danielbachhuber
Copy link
Member

Separate PR sounds good

@danielbachhuber danielbachhuber added this to the 2.3.0 milestone Apr 12, 2024
@danielbachhuber danielbachhuber merged commit e27f110 into wp-cli:main Apr 12, 2024
36 checks passed
@ernilambar ernilambar deleted the feature-github-support branch April 26, 2024 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accept github option for --ci when scaffolding plugin and theme tests
2 participants