Skip to content

Commit

Permalink
Merge pull request #102 from Automattic/release/0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryJones authored Aug 12, 2024
2 parents 6d021c7 + 92b9581 commit d9aa930
Show file tree
Hide file tree
Showing 41 changed files with 2,772 additions and 1,132 deletions.
19 changes: 19 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Specify which files should not be included in the push to WordPress.org.
# These are all development files and directories.
# The deploy Action will use rsync + .distignore if the .distignore exists,
# so it doesn't care what may or may not be ignored via .gitignore.

/.github/
/bin/
/tests/
/.distignore
/.editorconfig
/.gitattributes
/.gitignore
/.phpcs.xml.dist
/CHANGELOG.md
/composer.json
/mixtape.json
/package.json
/package-lock.json
/phpunit.xml.dist
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = 4
eclint_block_comment_start = /*
eclint_block_comment = *
eclint_block_comment_end = */

[*.yml]
indent_style = space
Expand All @@ -23,3 +27,6 @@ trim_trailing_whitespace = false

[*.txt]
end_of_line = crlf

[LICENSE]
indent_style = unset
33 changes: 33 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Exclude these files from GitHub release archives.
# This will also make them unavailable when using Composer with `--prefer-dist`.
# If you develop for this plugin using Composer, use `--prefer-source`.
# https://blog.madewithlove.be/post/gitattributes/

/.github/ export-ignore
/.wordpress-org/ export-ignore
/node_modules/ export-ignore
/bin/ export-ignore
/tests/ export-ignore

/.distignore export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.phpcs.xml.dist export-ignore
/CHANGELOG.md export-ignore
/composer.json export-ignore
/mixtape.json export-ignore
/package.json export-ignore
/package-lock.json export-ignore
/phpunit.xml.dist export-ignore

# Auto detect text files and perform LF normalization
# https://pablorsk.medium.com/be-a-git-ninja-the-gitattributes-file-e58c07c9e915

* text=auto

# The above will handle all files NOT found below

*.md text
*.php text
*.inc text
10 changes: 5 additions & 5 deletions .github/workflows/cs-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ on:
workflow_dispatch:

jobs:
checkcs:
check_cs:
name: "Basic CS and QA checks"
runs-on: ubuntu-latest

env:
XMLLINT_INDENT: " "
XMLLINT_INDENT: "\x09"

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
php-version: "8.3"
coverage: none
tools: cs2pr

Expand All @@ -37,7 +37,7 @@ jobs:
uses: korelstar/xmllint-problem-matcher@v1

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

# Validate the composer.json file.
# @link https://getcomposer.org/doc/03-cli.md#validate
Expand All @@ -47,7 +47,7 @@ jobs:
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: ramsey/composer-install@v1
uses: ramsey/composer-install@v3

# Lint PHP.
- name: Lint PHP against parse errors
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy to WordPress.org
on:
release:
types: [ released ]
# Allow manual triggering of the workflow.
workflow_dispatch:
jobs:
release:
name: New release to WordPress.org
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Push to WordPress.org
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SLUG: zoninator
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
72 changes: 31 additions & 41 deletions .github/workflows/integrations.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,75 @@
name: Run PHPUnit

on:
# Run on all pushes and on all pull requests.
# Prevent the "push" build from running when there are only irrelevant changes.
push:
paths-ignore:
- "**.md"
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
test:
name: WP ${{ matrix.wordpress }} on PHP ${{ matrix.php }}
# Ubuntu-20.x includes MySQL 8.0, which causes `caching_sha2_password` issues with PHP < 7.4
# https://www.php.net/manual/en/mysqli.requirements.php
# TODO: change to ubuntu-latest when we no longer support PHP < 7.4
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allowed_failure }}

env:
WP_VERSION: ${{ matrix.wordpress }}

strategy:
matrix:
wordpress: ["5.5", "5.6", "5.7"]
php: ["5.6", "7.0", "7.1", "7.2", "7.3", "7.4"]
include:
- php: "8.0"
# Ignore platform requirements, so that PHPUnit 7.5 can be installed on PHP 8.0 (and above).
composer-options: "--ignore-platform-reqs"
extensions: pcov
ini-values: pcov.directory=., "pcov.exclude=\"~(vendor|tests)~\""
coverage: pcov
exclude:
- php: "8.0"
wordpress: "5.5"
# 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@v2
uses: actions/checkout@v4

- name: Setup 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: "${{ matrix.composer-options }}"

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

# Setup PCOV since we're using PHPUnit < 8 which has it integrated. Requires PHP 7.1.
# Ignore platform reqs to make it install on PHP 8.
# https://github.com/krakjoe/pcov-clobber
- name: Setup PCOV
if: ${{ matrix.php == 8.0 }}
run: |
composer require pcov/clobber --ignore-platform-reqs
vendor/bin/pcov clobber
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install Composer dependencies
uses: ramsey/composer-install@v1
with:
composer-options: "${{ matrix.composer-options }}"
- 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: Prepare environment for integration tests
run: composer prepare-ci
run: composer prepare-ci ${{ matrix.wordpress }}

- name: Run integration tests (single site)
if: ${{ matrix.php != 8.0 }}
run: composer test
- name: Run integration tests (single site with code coverage)
if: ${{ matrix.php == 8.0 }}
run: composer coverage-ci

- name: Run integration tests (multisite)
run: composer test-ms
Loading

0 comments on commit d9aa930

Please sign in to comment.