Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 25dac3a

Browse files
authored
Merge pull request #1107 from Automattic/release/5.0.0
2 parents da073ea + 9303541 commit 25dac3a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1732
-1680
lines changed

.editorconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This file is for unifying the coding style for different editors and IDEs.
2+
# It is based on https://core.trac.wordpress.org/browser/trunk/.editorconfig.
3+
# See https://editorconfig.org for more information about the standard.
4+
5+
# WordPress Coding Standards
6+
# https://make.wordpress.org/core/handbook/coding-standards/
7+
8+
root = true
9+
10+
[*]
11+
charset = utf-8
12+
end_of_line = lf
13+
insert_final_newline = true
14+
trim_trailing_whitespace = true
15+
indent_style = tab
16+
17+
[*.yml]
18+
indent_style = space
19+
indent_size = 2
20+
21+
[*.md]
22+
trim_trailing_whitespace = false
23+
24+
[*.txt]
25+
end_of_line = crlf

.github/workflows/cs-lint.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: CS & Lint
2+
3+
on:
4+
# Run on all pushes and on all pull requests.
5+
# Prevent the "push" build from running when there are only irrelevant changes.
6+
push:
7+
paths-ignore:
8+
- '**.md'
9+
pull_request:
10+
# Allow manually triggering the workflow.
11+
workflow_dispatch:
12+
13+
# Cancels all previous workflow runs for the same branch that have not yet completed.
14+
concurrency:
15+
# The concurrency group contains the workflow name and the branch name.
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
checkcs:
21+
name: 'Basic CS and QA checks'
22+
runs-on: ubuntu-20.04
23+
24+
env:
25+
XMLLINT_INDENT: ' '
26+
27+
steps:
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: '7.4'
32+
coverage: none
33+
tools: cs2pr
34+
35+
# Show PHP lint violations inline in the file diff.
36+
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
37+
- name: Register PHP lint violations to appear as file diff comments
38+
uses: korelstar/phplint-problem-matcher@v1
39+
40+
# Show XML violations inline in the file diff.
41+
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
42+
- name: Register XML violations to appear as file diff comments
43+
uses: korelstar/xmllint-problem-matcher@v1
44+
45+
- name: Checkout code
46+
uses: actions/checkout@v3
47+
48+
# Validate the composer.json file.
49+
# @link https://getcomposer.org/doc/03-cli.md#validate
50+
- name: Validate Composer installation
51+
run: composer validate --no-check-all --strict --no-interaction
52+
53+
# Install dependencies and handle caching in one go.
54+
# @link https://github.com/marketplace/actions/install-composer-dependencies
55+
- name: Install Composer dependencies
56+
uses: ramsey/composer-install@v2
57+
58+
# Lint PHP.
59+
- name: Lint PHP against parse errors
60+
run: composer lint-ci --no-interaction | cs2pr
61+
62+
# Needed as runs-on: system doesn't have xml-lint by default.
63+
# @link https://github.com/marketplace/actions/xml-lint
64+
- name: Lint phpunit.xml.dist
65+
uses: ChristophWurst/xmllint-action@v1
66+
with:
67+
xml-file: ./phpunit.xml.dist
68+
xml-schema-file: ./vendor/phpunit/phpunit/phpunit.xsd
69+
70+
- name: Lint .phpcs.xml.dist
71+
uses: ChristophWurst/xmllint-action@v1
72+
with:
73+
xml-file: ./.phpcs.xml.dist
74+
xml-schema-file: ./vendor/squizlabs/php_codesniffer/phpcs.xsd
75+
76+
# Check the code-style consistency of the PHP files.
77+
# - name: Check PHP code style
78+
# run: composer cs -- --report-full --report-checkstyle=./phpcs-report.xml
79+
#
80+
# - name: Show PHPCS results in PR
81+
# run: cs2pr ./phpcs-report.xml

.github/workflows/deploy.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Deploy to WordPress.org
2+
on:
3+
release:
4+
types: [released]
5+
# Allow manually triggering the workflow.
6+
workflow_dispatch:
7+
jobs:
8+
release:
9+
name: New release to WordPress.org
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Build # Remove or modify this step as needed
15+
run: composer install --no-dev --classmap-authoritative
16+
- name: Push to WordPress.org
17+
uses: 10up/action-wordpress-plugin-deploy@stable
18+
env:
19+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
20+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}

.github/workflows/tests.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Integration Tests
2+
3+
on:
4+
# Run on all pushes and on all pull requests.
5+
# Prevent the "push" build from running when there are only irrelevant changes.
6+
push:
7+
paths-ignore:
8+
- '**.md'
9+
pull_request:
10+
11+
# Cancels all previous workflow runs for the same branch that have not yet completed.
12+
concurrency:
13+
# The concurrency group contains the workflow name and the branch name.
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
test:
19+
name: PHP ${{ matrix.php }}
20+
runs-on: ubuntu-20.04
21+
22+
env:
23+
WP_VERSION: ${{ matrix.wp }}
24+
25+
strategy:
26+
# PHP 7.1 uses PHPUnit 7.5.20
27+
# PHP 7.2 uses PHPUnit 8.5.21
28+
# PHP 7.3 uses PHPUnit 9.5.10
29+
# PHP 7.4 uses PHPUnit 9.5.10
30+
# PHP 8.0 uses PHPUnit 9.5.10
31+
# PHP 8.1 uses PHPUnit 9.5.10
32+
# PHP 8.2 uses PHPUnit 9.5.10
33+
# Keys:
34+
# - experimental: Whether the build is "allowed to fail".
35+
matrix:
36+
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
37+
wp: ['latest']
38+
experimental: [false]
39+
include:
40+
- php: '7.1'
41+
wp: '5.8.5'
42+
experimental: false
43+
- php: '8.2'
44+
wp: 'trunk'
45+
experimental: true
46+
fail-fast: false
47+
continue-on-error: ${{ matrix.experimental }}
48+
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@v3
51+
52+
- name: Setup PHP ${{ matrix.php }}
53+
uses: shivammathur/setup-php@v2
54+
with:
55+
php-version: ${{ matrix.php }}
56+
extensions: ${{ matrix.extensions }}
57+
ini-values: ${{ matrix.ini-values }}
58+
59+
- name: Setup problem matchers for PHP
60+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
61+
62+
- name: Setup Problem Matchers for PHPUnit
63+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
64+
65+
- name: Install Composer dependencies
66+
uses: ramsey/composer-install@v2
67+
68+
- name: Start MySQL Service
69+
run: sudo systemctl start mysql.service
70+
71+
- name: Setting mysql_native_password for PHP <= 7.3
72+
if: ${{ matrix.php <= 7.3 }}
73+
run: mysql -u root -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';"
74+
75+
- name: Prepare environment for integration tests
76+
run: composer prepare-ci --no-interaction
77+
78+
- name: Run integration tests (multi site)
79+
run: composer test-ms --no-interaction

.gitignore

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
.DS_Store
2-
vendor
3-
resty
4-
jsawk
5-
facebook-instant-articles-wp.zip
1+
/facebook-instant-articles-wp.zip
2+
/.phpcs.xml
3+
/.phpunit.result.cache
4+
/.wp-env.override.json
5+
/composer.lock
6+
/vendor

.phpcs.xml.dist

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0"?>
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="wp-parsely" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
3+
<description>Custom ruleset for instant-articles plugin.</description>
4+
5+
<!-- For help in understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
6+
<!-- For help in using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
7+
8+
<!-- What to scan -->
9+
<file>.</file>
10+
<!-- Ignoring Files and Folders:
11+
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders -->
12+
<exclude-pattern>/tests/Facebook/</exclude-pattern>
13+
<exclude-pattern>/vendor/</exclude-pattern>
14+
15+
<!-- How to scan -->
16+
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
17+
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
18+
<!-- Show sniff and progress -->
19+
<arg value="sp"/>
20+
<!-- Strip the file paths down to the relevant bit -->
21+
<arg name="basepath" value="./"/>
22+
<!-- Show results with colors -->
23+
<arg name="colors"/>
24+
<!-- Limit to PHP files -->
25+
<arg name="extensions" value="php"/>
26+
<!-- Enables parallel processing when available for faster results. -->
27+
<arg name="parallel" value="8"/>
28+
29+
<!-- Rules: Check PHP version compatibility - see
30+
https://github.com/PHPCompatibility/PHPCompatibilityWP -->
31+
<rule ref="PHPCompatibilityWP"/>
32+
<!-- For help in understanding this testVersion:
33+
https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
34+
<config name="testVersion" value="7.1-"/>
35+
36+
<!-- Rules: WordPress Coding Standards - see
37+
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
38+
<!-- WordPress-Extra includes WordPress-Core -->
39+
<rule ref="WordPress-Extra"/>
40+
<rule ref="WordPress-Docs"/>
41+
<!-- For help in understanding these custom sniff properties:
42+
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
43+
<config name="minimum_supported_wp_version" value="4.3"/>
44+
45+
<!-- Rules: WordPress VIP - see
46+
https://github.com/Automattic/VIP-Coding-Standards -->
47+
<rule ref="WordPress-VIP-Go"/>
48+
49+
<!-- <rule ref="WordPress.NamingConventions.PrefixAllGlobals">-->
50+
<!-- <properties>-->
51+
<!-- <property name="prefixes" type="array">-->
52+
<!-- <element value="instant_articles"/>-->
53+
<!-- </property>-->
54+
<!-- </properties>-->
55+
<!-- </rule>-->
56+
57+
<!-- <rule ref="WordPress.WP.I18n">-->
58+
<!-- <properties>-->
59+
<!-- <property name="text_domain" type="array">-->
60+
<!-- <element value="instant-articles"/>-->
61+
<!-- </property>-->
62+
<!-- </properties>-->
63+
<!-- </rule>-->
64+
65+
<!-- <rule ref="WordPress.WhiteSpace.ControlStructureSpacing">-->
66+
<!-- <properties>-->
67+
<!-- <property name="blank_line_check" value="true"/>-->
68+
<!-- </properties>-->
69+
<!-- </rule>-->
70+
71+
</ruleset>

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)