Skip to content

Add GitHub as valid CI for plugin and theme scaffold#331

Merged
danielbachhuber merged 2 commits intowp-cli:mainfrom
ernilambar:feature-github-support
Apr 12, 2024
Merged

Add GitHub as valid CI for plugin and theme scaffold#331
danielbachhuber merged 2 commits intowp-cli:mainfrom
ernilambar:feature-github-support

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 added the command:scaffold-plugin-tests Related to 'scaffold plugin-tests' command label Apr 12, 2024
@danielbachhuber danielbachhuber merged commit e27f110 into wp-cli:main Apr 12, 2024
@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

Labels

command:scaffold-plugin-tests Related to 'scaffold plugin-tests' command

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