-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 97-set-jetpack-to-staging-on-non-production-…
…sites
- Loading branch information
Showing
39 changed files
with
347 additions
and
133 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
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,44 @@ | ||
name: "All Pull Request Tests" | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
|
||
jobs: | ||
# We use a single job to ensure that all steps run in the same environment and | ||
# reduce the number of minutes used. | ||
pr-tests: | ||
# Don't run on draft PRs | ||
if: github.event.pull_request.draft == false | ||
# Timeout after 10 minutes | ||
timeout-minutes: 10 | ||
# Define a matrix of PHP/WordPress versions to test against | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [8.1, 8.2, 8.3] | ||
wordpress: ["latest"] | ||
multisite: [false, true] | ||
runs-on: ubuntu-latest | ||
# Cancel any existing runs of this workflow | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }}-MS${{ matrix.multisite }} | ||
cancel-in-progress: true | ||
# Name the job in the matrix | ||
name: "PR Tests PHP ${{ matrix.php }} WordPress ${{ matrix.wordpress }} Multisite ${{ matrix.multisite }}" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Run General Tests | ||
# See https://github.com/alleyinteractive/action-test-general for more options | ||
uses: alleyinteractive/action-test-general@develop | ||
|
||
- name: Run PHP Tests | ||
# See https://github.com/alleyinteractive/action-test-php for more options | ||
uses: alleyinteractive/action-test-php@develop | ||
with: | ||
php-version: '${{ matrix.php }}' | ||
skip-audit: 'true' | ||
skip-wordpress-install: 'true' | ||
wordpress-version: '${{ matrix.wordpress }}' | ||
wordpress-multisite: '${{ matrix.multisite }}' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
name: wp-alleyvate@feature | ||
|
||
inputs: | ||
- name: featureName | ||
description: "Feature Name" | ||
type: string | ||
- name: tests | ||
description: "Include Tests?" | ||
type: boolean | ||
default: true | ||
|
||
files: | ||
- source: feature.php.hbs | ||
destination: src/alley/wp/alleyvate/features/{{ wpClassFilename inputs.featureName }} | ||
- source: test.php.hbs | ||
if: "{{ inputs.tests }}" | ||
destination: tests/alley/wp/alleyvate/features/{{ wpClassFilename inputs.featureName prefix="test-" }} |
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,27 @@ | ||
<?php | ||
/** | ||
* Class file for {{ wpClassName inputs.featureName }} | ||
* | ||
* (c) Alley <info@alley.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @package wp-alleyvate | ||
*/ | ||
|
||
namespace Alley\WP\Alleyvate\Features; | ||
|
||
use Alley\WP\Types\Feature; | ||
|
||
/** | ||
* {{ wpClassName inputs.featureName }} feature. | ||
*/ | ||
final class {{ wpClassName inputs.featureName }} implements Feature { | ||
/** | ||
* Boot the feature. | ||
*/ | ||
public function boot(): void { | ||
// ... | ||
} | ||
} |
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,51 @@ | ||
<?php | ||
/** | ||
* Class file for {{ wpClassName inputs.featureName prefix="Test_" }} | ||
* | ||
* (c) Alley <info@alley.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @package wp-alleyvate | ||
*/ | ||
|
||
declare( strict_types=1 ); | ||
|
||
namespace Alley\WP\Alleyvate\Features; | ||
|
||
use Mantle\Testing\Concerns\Refresh_Database; | ||
use Mantle\Testkit\Test_Case; | ||
|
||
/** | ||
* Tests for {{ wpClassName inputs.featureName }} feature. | ||
*/ | ||
final class {{ wpClassName inputs.featureName prefix="Test_" }} extends Test_Case { | ||
use Refresh_Database; | ||
|
||
/** | ||
* Feature instance. | ||
* | ||
* @var {{ wpClassName inputs.featureName }} | ||
*/ | ||
private {{ wpClassName inputs.featureName }} $feature; | ||
|
||
/** | ||
* Set up. | ||
*/ | ||
protected function setUp(): void { | ||
parent::setUp(); | ||
|
||
$this->feature = new {{ wpClassName inputs.featureName }}(); | ||
} | ||
|
||
/** | ||
* Example Test. | ||
*/ | ||
public function test_example(): void { | ||
// Activate the feature. | ||
$this->feature->boot(); | ||
|
||
$this->assertTrue( true ); | ||
} | ||
} |
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
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
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,13 +1,13 @@ | ||
<?xml version="1.0"?> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
bootstrap="tests/bootstrap.php" | ||
backupGlobals="false" | ||
colors="true" | ||
convertDeprecationsToExceptions="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd" | ||
cacheDirectory=".phpunit.result.cache" | ||
> | ||
<testsuite name="unit"> | ||
<directory suffix=".php">tests/alley/wp/</directory> | ||
</testsuite> | ||
<testsuite name="unit"> | ||
<directory suffix="Test.php">tests/Alley/WP/</directory> | ||
</testsuite> | ||
</phpunit> |
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
Oops, something went wrong.