Skip to content

Commit

Permalink
Merge branch 'develop' into update/amphtml-spec-2309011827000
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter authored Oct 12, 2023
2 parents 067e692 + 4132152 commit ca8cc7f
Show file tree
Hide file tree
Showing 17 changed files with 2,562 additions and 2,005 deletions.
59 changes: 31 additions & 28 deletions .github/workflows/build-test-measure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ jobs:
- name: Checkout including last 2 commits
# Fetch last 2 commits if it's not a PR, so that we can determine the list of modified files.
if: ${{ github.base_ref == null }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Checkout
# Do usual checkout if it's a PR.
if: ${{ github.base_ref != null }}
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Fetch base branch
# Only fetch base ref if it's a PR.
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3.8.1
Expand All @@ -114,7 +114,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3.8.1
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -218,7 +218,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Configure Composer cache
uses: actions/cache@v3.3.1
uses: actions/cache@v3.3.2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -240,7 +240,7 @@ jobs:
if: needs.pre-run.outputs.changed-php-count > 0 || needs.pre-run.outputs.changed-gha-workflow-count > 0
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -255,7 +255,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Configure Composer cache
uses: actions/cache@v3.3.1
uses: actions/cache@v3.3.2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -280,7 +280,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3.8.1
Expand All @@ -289,7 +289,7 @@ jobs:
cache: npm

- name: Setup Jest cache
uses: actions/cache@v3.3.1
uses: actions/cache@v3.3.2
with:
path: ~/.jest-cache
key: ${{ runner.os }}-jest
Expand Down Expand Up @@ -318,7 +318,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -336,7 +336,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Configure Composer cache
uses: actions/cache@v3.3.1
uses: actions/cache@v3.3.2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down Expand Up @@ -383,6 +383,8 @@ jobs:
needs: pre-run
env:
WP_CORE_DIR: /tmp/wordpress
WP_TESTS_DIR: /tmp/wordpress-tests-lib
WP_ENVIRONMENT_TYPE: local
services:
mysql:
image: mariadb:latest
Expand Down Expand Up @@ -462,7 +464,7 @@ jobs:

- name: Checkout
if: needs.pre-run.outputs.changed-php-count > 0
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
if: needs.pre-run.outputs.changed-php-count > 0
Expand Down Expand Up @@ -498,7 +500,7 @@ jobs:

- name: Configure Composer cache
if: needs.pre-run.outputs.changed-php-count > 0
uses: actions/cache@v3.3.1
uses: actions/cache@v3.3.2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down Expand Up @@ -544,18 +546,24 @@ jobs:
if: needs.pre-run.outputs.changed-php-count > 0
run: cp -r "$PWD" "$WP_CORE_DIR/src/wp-content/plugins/amp"

- name: Setup required WP constants
- name: Override default PHPUnit configuration
if: ${{ matrix.experimental == true && needs.pre-run.outputs.changed-php-count > 0 }}
run: |
echo "WP_ENVIRONMENT_TYPE=local" >> $GITHUB_ENV
cp phpunit.xml.dist phpunit.xml
# Avoid converting deprecations, errors, notices, and warnings to exceptions in experimental mode.
sed -i 's/convertDeprecationsToExceptions="true"/convertDeprecationsToExceptions="false"/g' phpunit.xml
sed -i 's/convertErrorsToExceptions="true"/convertErrorsToExceptions="false"/g' phpunit.xml
sed -i 's/convertNoticesToExceptions="true"/convertNoticesToExceptions="false"/g' phpunit.xml
sed -i 's/convertWarningsToExceptions="true"/convertWarningsToExceptions="false"/g' phpunit.xml
working-directory: ${{ env.WP_CORE_DIR }}/src/wp-content/plugins/amp

- name: Run tests
if: ${{ matrix.coverage == false && needs.pre-run.outputs.changed-php-count > 0 }}
run: |
phpunit --version
phpunit --verbose
working-directory: ${{ env.WP_CORE_DIR }}/src/wp-content/plugins/amp
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib

- name: Run multisite tests
if: ${{ matrix.multisite == true && needs.pre-run.outputs.changed-php-count > 0 }}
Expand All @@ -564,7 +572,6 @@ jobs:
phpunit --verbose
working-directory: ${{ env.WP_CORE_DIR }}/src/wp-content/plugins/amp
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib
WP_MULTISITE: 1

- name: Run tests with coverage
Expand All @@ -573,17 +580,13 @@ jobs:
phpunit --version
phpunit --verbose --coverage-clover ${{ env.WP_CORE_DIR }}/src/wp-content/plugins/amp/build/logs/clover.xml
working-directory: ${{ env.WP_CORE_DIR }}/src/wp-content/plugins/amp
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib

- name: Run external HTTP tests
if: ${{ matrix.external-http == true && needs.pre-run.outputs.changed-php-count > 0 }}
run: |
phpunit --version
phpunit --testsuite external-http --verbose
working-directory: ${{ env.WP_CORE_DIR }}/src/wp-content/plugins/amp
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib

- name: Upload code coverage report
if: ${{ matrix.coverage == true && needs.pre-run.outputs.changed-php-count > 0 && github.actor != 'dependabot[bot]' }}
Expand Down Expand Up @@ -641,7 +644,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -671,7 +674,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Configure Composer cache
uses: actions/cache@v3.3.1
uses: actions/cache@v3.3.2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down Expand Up @@ -752,7 +755,7 @@ jobs:

steps:
- name: Check out source files
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -770,7 +773,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Configure Composer cache
uses: actions/cache@v3.3.1
uses: actions/cache@v3.3.2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Draft release
uses: ./.github/actions/draft-release
Expand Down
1 change: 1 addition & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<exclude name="WordPress.PHP.IniSet.display_errors_Disallowed" />
<exclude name="Universal.NamingConventions.NoReservedKeywordParameterNames.matchFound" />
<exclude name="WordPress.Security.NonceVerification.Missing" />
<exclude name="WordPress.Security.EscapeOutput.ExceptionNotEscaped" />
</rule>

<rule ref="WordPress-Docs">
Expand Down
Loading

0 comments on commit ca8cc7f

Please sign in to comment.