-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fix/42-non-ascii-characters-rebased
- Loading branch information
Showing
35 changed files
with
1,066 additions
and
248 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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# The following teams will get auto-tagged for a review. | ||
# See https://docs.github.com/en/enterprise/2.15/user/articles/about-code-owners | ||
|
||
* @Automattic/redirector |
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 @@ | ||
name: Behat Testing | ||
|
||
on: | ||
push: | ||
paths: | ||
- '.github/workflows/behat-test.yml' | ||
- '**.php' | ||
- '**.feature' | ||
- 'behat.yml' | ||
- 'composer.json' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/behat-test.yml' | ||
- '**.php' | ||
- '**.feature' | ||
- 'behat.yml' | ||
- 'composer.json' | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
behat: | ||
uses: automattic/wpvip-plugins-.github/.github/workflows/reusable-behat-test.yml@trunk |
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,73 @@ | ||
name: Integration Tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test: | ||
name: WP ${{ matrix.wordpress }} on PHP ${{ matrix.php }} | ||
runs-on: ubuntu-latest | ||
continue-on-error: ${{ matrix.allowed_failure }} | ||
|
||
env: | ||
WP_VERSION: ${{ matrix.wordpress }} | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
# Check lowest supported WP version, with the lowest supported PHP. | ||
- wordpress: '5.9' | ||
php: '7.4' | ||
allowed_failure: false | ||
# Check latest WP with the highest supported PHP. | ||
- wordpress: 'latest' | ||
php: 'latest' | ||
allowed_failure: false | ||
# Check upcoming WP. | ||
- wordpress: 'trunk' | ||
php: 'latest' | ||
allowed_failure: true | ||
# Check upcoming PHP - only needed when a new version has been forked (typically Sep-Nov) | ||
# - wordpress: 'trunk' | ||
# php: 'nightly' | ||
# allowed_failure: true | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: ${{ matrix.extensions }} | ||
ini-values: ${{ matrix.ini-values }} | ||
coverage: ${{ matrix.coverage }} | ||
|
||
- name: Install Composer dependencies | ||
uses: ramsey/composer-install@v3 | ||
with: | ||
composer-options: --ignore-platform-req=php+ | ||
|
||
- name: Set up problem matchers for PHP | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
|
||
- name: Set up problem matchers for PHPUnit | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
||
- name: Show PHP and PHPUnit version info | ||
run: | | ||
php --version | ||
./vendor/bin/phpunit --version | ||
- name: Start MySQL service | ||
run: sudo systemctl start mysql.service | ||
|
||
- name: Install WordPress environment | ||
run: composer prepare ${{ matrix.wordpress }} | ||
|
||
- name: Run integration tests (single site) | ||
run: composer test-integration | ||
|
||
- name: Run integration tests (multisite) | ||
run: composer test-integration-ms |
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,67 @@ | ||
name: Unit Tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test: | ||
name: WP ${{ matrix.wordpress }} on PHP ${{ matrix.php }} | ||
runs-on: ubuntu-latest | ||
continue-on-error: ${{ matrix.allowed_failure }} | ||
|
||
env: | ||
WP_VERSION: ${{ matrix.wordpress }} | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
# Check lowest supported WP version, with the lowest supported PHP. | ||
- wordpress: '5.9' | ||
php: '7.4' | ||
allowed_failure: false | ||
# Check latest WP with the highest supported PHP. | ||
- wordpress: 'latest' | ||
php: 'latest' | ||
allowed_failure: false | ||
# Check upcoming WP. | ||
- wordpress: 'trunk' | ||
php: 'latest' | ||
allowed_failure: true | ||
# Check upcoming PHP - only needed when a new version has been forked (typically Sep-Nov) | ||
# - wordpress: 'trunk' | ||
# php: 'nightly' | ||
# allowed_failure: true | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: ${{ matrix.extensions }} | ||
ini-values: ${{ matrix.ini-values }} | ||
coverage: ${{ matrix.coverage }} | ||
|
||
- name: Install Composer dependencies | ||
uses: ramsey/composer-install@v3 | ||
with: | ||
composer-options: --ignore-platform-req=php+ | ||
|
||
- name: Set up problem matchers for PHP | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
|
||
- name: Set up problem matchers for PHPUnit | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
||
- name: Show PHP and PHPUnit version info | ||
run: | | ||
php --version | ||
./vendor/bin/phpunit --version | ||
- name: Run unit tests (single site) | ||
run: composer test-unit | ||
|
||
- name: Run unit tests (multisite) | ||
run: composer test-unit-ms |
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,62 @@ | ||
<?xml version="1.0"?> | ||
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="wpcom-legacy-redirector" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"> | ||
<description>Custom ruleset for wpcom-legacy-redirector plugin.</description> | ||
|
||
<!-- For help in understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml --> | ||
<!-- For help in using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage --> | ||
|
||
<!-- What to scan --> | ||
<file>.</file> | ||
<!-- Ignoring Files and Folders: | ||
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders --> | ||
<exclude-pattern>/vendor/</exclude-pattern> | ||
|
||
<!-- How to scan --> | ||
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage --> | ||
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml --> | ||
<!-- Show sniff and progress --> | ||
<arg value="sp"/> | ||
<!-- Strip the file paths down to the relevant bit --> | ||
<arg name="basepath" value="./"/> | ||
<!-- Show results with colors --> | ||
<arg name="colors"/> | ||
<!-- Limit to PHP files --> | ||
<arg name="extensions" value="php"/> | ||
<!-- Enables parallel processing when available for faster results. --> | ||
<arg name="parallel" value="8"/> | ||
|
||
<!-- Rules: Check PHP version compatibility - see | ||
https://github.com/PHPCompatibility/PHPCompatibilityWP --> | ||
<rule ref="PHPCompatibilityWP"/> | ||
<!-- For help in understanding this testVersion: | ||
https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions --> | ||
<config name="testVersion" value="7.4-"/> | ||
|
||
<!-- Rules: WordPress Coding Standards - see | ||
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards --> | ||
<!-- WordPress-Extra includes WordPress-Core --> | ||
<rule ref="WordPress-Extra"/> | ||
<rule ref="WordPress-Docs"/> | ||
<!-- For help in understanding these custom sniff properties: | ||
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties --> | ||
<config name="minimum_supported_wp_version" value="5.9"/> | ||
|
||
<rule ref="WordPress.WP.I18n"> | ||
<properties> | ||
<property name="text_domain" type="array"> | ||
<element value="wpcom-legacy-redirector"/> | ||
</property> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing"> | ||
<properties> | ||
<property name="blank_line_check" value="true"/> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="WordPress.Files.FileName"> | ||
<exclude-pattern>tests/</exclude-pattern> | ||
</rule> | ||
|
||
</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
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,7 @@ | ||
default: | ||
suites: | ||
default: | ||
contexts: | ||
- Automattic\LegacyRedirector\Tests\Behat\FeatureContext | ||
paths: | ||
- features |
Oops, something went wrong.