wp-cli / php-cli-tools

A collection of tools to help with PHP command line utilities
MIT License
676 stars 118 forks source link

Restore CI unit tests on `wp-cli/php-cli-tools` #151

Closed danielbachhuber closed 2 years ago

danielbachhuber commented 2 years ago

Fixes #150

danielbachhuber commented 2 years ago

@schlessera Can you provide some direction as to whether there's a better way to do this?

schlessera commented 2 years ago

@danielbachhuber I've been working on getting all packages to reuse the same testing setup, to simplify maintenance. To "hoist" this package unto the shared testing environment, you'd start by adding the package to the automated syncs in https://github.com/wp-cli/.github/blob/main/.github/workflows/sync-workflows.yml You can initially do a PR where you copy the shared CI workflows from https://github.com/wp-cli/.github/blob/main/.github/workflows/ to test without breaking the default branch, and only then add them to the automated sync. The testing steps are done conditionally based on whether the configuration files can be found for the respective tools. For the lining, we use a shared code standard via https://github.com/wp-cli/wp-cli-tests/blob/main/phpcs.xml.dist that each repo then extends to add exceptions.

danielbachhuber commented 2 years ago

I've been working on getting all packages to reuse the same testing setup, to simplify maintenance. To "hoist" this package unto the shared testing environment, you'd start by adding the package to the automated syncs in https://github.com/wp-cli/.github/blob/main/.github/workflows/sync-workflows.yml

@schlessera Awesome! Added with https://github.com/wp-cli/.github/pull/19

You can initially do a PR where you copy the shared CI workflows from https://github.com/wp-cli/.github/blob/main/.github/workflows/ to test without breaking the default branch, and only then add them to the automated sync.

Looks like the unit tests pass. I'll keep https://github.com/wp-cli/php-cli-tools/issues/150 open to handle any fallout from the sync.

The testing steps are done conditionally based on whether the configuration files can be found for the respective tools. For the lining, we use a shared code standard via https://github.com/wp-cli/wp-cli-tests/blob/main/phpcs.xml.dist that each repo then extends to add exceptions.

👍