-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
143 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Code Quality Checks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
code-quality: | ||
uses: wp-cli/.github/.github/workflows/reusable-code-quality.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
name: Release | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v4 | ||
with: | ||
target-branch: ${{ github.ref_name }} | ||
config-file: release-please-config.json | ||
manifest-file: .release-please-manifest.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,16 @@ | ||
name: Testing | ||
|
||
on: [push, pull_request] | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
schedule: | ||
- cron: '17 1 * * *' # Run every day on a seemly random time. | ||
|
||
jobs: | ||
functional: | ||
name: Functional - WP ${{ matrix.wp }} on PHP ${{ matrix.php }} | ||
continue-on-error: ${{ matrix.experimental == true }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['7.3', '7.4', '8.0'] | ||
wp: ['latest'] | ||
test: ["composer behat || composer behat-rerun"] | ||
include: | ||
- php: '8.0' | ||
wp: 'trunk' | ||
test: "composer behat || composer behat-rerun" | ||
- php: '8.1' | ||
wp: 'trunk' | ||
experimental: true | ||
|
||
runs-on: ubuntu-latest | ||
|
||
services: | ||
mysql: | ||
image: mysql:5.7 | ||
ports: | ||
- 3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=wp_cli_test --entrypoint sh mysql:5.7 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" | ||
|
||
steps: | ||
- name: Check out source code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '${{ matrix.php }}' | ||
extensions: mysql, zip | ||
coverage: none | ||
tools: composer:v2 | ||
|
||
# - name: Shutdown default MySQL service | ||
# run: sudo service mysql stop | ||
|
||
- name: Start MySQL server | ||
run: sudo service mysql start | ||
|
||
- name: Get Composer cache Directory | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Use Composer cache | ||
uses: actions/cache@master | ||
with: | ||
path: ${{ steps['composer-cache'].outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install dependencies | ||
run: composer update --prefer-stable --prefer-dist --no-progress --no-interaction | ||
|
||
- name: Configure DB environment | ||
run: | | ||
export MYSQL_HOST=127.0.0.1 | ||
export MYSQL_TCP_PORT=${{ job.services.mysql.ports['3306'] }} | ||
echo "WP_CLI_TEST_DBROOTUSER=root" >> $GITHUB_ENV | ||
echo "WP_CLI_TEST_DBROOTPASS=root" >> $GITHUB_ENV | ||
echo "WP_CLI_TEST_DBUSER=wp_cli_test" >> $GITHUB_ENV | ||
echo "WP_CLI_TEST_DBPASS=password1" >> $GITHUB_ENV | ||
echo "WP_CLI_TEST_DBHOST=$MYSQL_HOST:$MYSQL_TCP_PORT" >> $GITHUB_ENV | ||
- name: Prepare test database | ||
run: composer prepare-tests | ||
|
||
- name: Check Behat environment | ||
run: WP_CLI_TEST_DEBUG_BEHAT_ENV=1 composer behat | ||
|
||
- name: Run Behat | ||
env: | ||
WP_VERSION: '${{ matrix.wp }}' | ||
run: ${{ matrix.test }} | ||
test: | ||
uses: wp-cli/.github/.github/workflows/reusable-testing.yml@main | ||
with: | ||
minimum-php: 7.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
wp-cli.local.yml | ||
vendor/ | ||
composer.lock | ||
/wp-cli.local.yml | ||
/node_modules | ||
/vendor | ||
*.zip | ||
*.tar.gz | ||
*.swp | ||
*.txt | ||
*.log | ||
/composer.lock | ||
/phpunit.xml | ||
/phpcs.xml | ||
.phpcs.xml | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "0.4.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
<?php | ||
|
||
namespace Hellonico\Fixtures; | ||
|
||
use WP_CLI; | ||
|
||
if (!class_exists('WP_CLI')) { | ||
return; | ||
if ( ! class_exists( 'WP_CLI' ) ) { | ||
return; | ||
} | ||
|
||
if (file_exists(__DIR__ . '/vendor/autoload.php')) { | ||
require_once __DIR__ . '/vendor/autoload.php'; | ||
$wp_fixtures_autoloader = __DIR__ . '/vendor/autoload.php'; | ||
|
||
if ( file_exists( $wp_fixtures_autoloader ) ) { | ||
require_once $wp_fixtures_autoloader; | ||
} | ||
|
||
WP_CLI::add_command('fixtures', __NAMESPACE__ . '\\Command'); | ||
WP_CLI::add_command( 'fixtures', 'Hellonico\Fixtures\Command' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="WP-CLI-PROJECT-NAME"> | ||
<description>Custom ruleset for WP-CLI PROJECT NAME</description> | ||
|
||
<!-- What to scan. --> | ||
<file>.</file> | ||
|
||
<!-- Show progress. --> | ||
<arg value="p"/> | ||
|
||
<!-- Strip the filepaths down to the relevant bit. --> | ||
<arg name="basepath" value="./"/> | ||
|
||
<!-- Check up to 8 files simultaneously. --> | ||
<arg name="parallel" value="8"/> | ||
|
||
<!-- For help understanding the `testVersion` configuration setting: | ||
https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions --> | ||
<config name="testVersion" value="7.2-"/> | ||
|
||
<!-- Rules: Include the base ruleset for WP-CLI projects. --> | ||
<rule ref="WP_CLI_CS"/> | ||
|
||
<!-- Verify that everything in the global namespace is either namespaced or prefixed. | ||
See: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#naming-conventions-prefix-everything-in-the-global-namespace --> | ||
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"> | ||
<properties> | ||
<property name="prefixes" type="array"> | ||
<element value="Hellonico\Fixtures"/><!-- Namespaces. --> | ||
<element value="wp_fixtures"/><!-- Global variables and such. --> | ||
</property> | ||
</properties> | ||
</rule> | ||
|
||
<!-- Whitelist property name for a a JSON-decoded object. --> | ||
<rule ref="WordPress.NamingConventions.ValidVariableName"> | ||
<properties> | ||
<property name="allowed_custom_properties" type="array"> | ||
<element value="sourcesContent"/> | ||
<element value="functionsScannerClass"/> | ||
</property> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/> | ||
|
||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"packages": { | ||
".": { | ||
"changelog-path": "CHANGELOG.md", | ||
"release-type": "php", | ||
"bump-minor-pre-major": false, | ||
"bump-patch-for-minor-pre-major": false, | ||
"draft": false, | ||
"prerelease": false, | ||
"include-v-in-tag": false | ||
} | ||
}, | ||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" | ||
} |