-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #253 from pantheon-systems/release_1.4.2
Release 1.4.2
- Loading branch information
Showing
19 changed files
with
707 additions
and
364 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,89 @@ | ||
name: Lint and Test | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
validate-readme-spacing: | ||
name: Validate README Spacing | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: pantheon-systems/validate-readme-spacing@v1 | ||
lint: | ||
name: PHPCS Linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/vendor | ||
key: test-lint-dependencies-{{ checksum "composer.json" }} | ||
restore-keys: test-lint-dependencies-{{ checksum "composer.json" }} | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.3 | ||
- name: Install dependencies | ||
run: composer install -n --prefer-dist | ||
- name: Run PHPCS | ||
run: composer lint | ||
php8-compatibility: | ||
name: PHP 8.x Compatibility | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: pantheon-systems/phpcompatibility-action@dev | ||
with: | ||
paths: ${{ github.workspace }}/*.php ${{ github.workspace }}/inc/*.php | ||
test-versions: 8.0- | ||
wporg-validation: | ||
name: WP.org Plugin Validation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: pantheon-systems/action-wporg-validator@1.0.0 | ||
with: | ||
type: 'plugin' | ||
test: | ||
needs: lint | ||
name: Test | ||
runs-on: ubuntu-latest | ||
services: | ||
mariadb: | ||
image: mariadb:10.5 | ||
strategy: | ||
matrix: | ||
php_version: [7.4, 8.3] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php_version }} | ||
extensions: mysqli, zip, imagick | ||
- name: Start MySQL Service | ||
run: sudo systemctl start mysql | ||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/vendor | ||
key: test-dependencies-{{ checksum "composer.json" }} | ||
restore-keys: test-dependencies-{{ checksum "composer.json" }} | ||
- name: Install dependencies | ||
run: | | ||
if [ ${{ matrix.php_version }} = "7.4" ]; then | ||
composer update | ||
fi | ||
composer install | ||
- name: Run PHPUnit | ||
run: bash ./bin/phpunit-test.sh |
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
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,61 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Initialize variables with default values | ||
TMPDIR="/tmp" | ||
DB_NAME="wordpress_test" | ||
DB_USER="root" | ||
DB_PASS="" | ||
DB_HOST="127.0.0.1" | ||
WP_VERSION="latest" | ||
SKIP_DB="" | ||
|
||
# Display usage information | ||
usage() { | ||
echo "Usage:" | ||
echo "./install-local-tests.sh [--dbname=wordpress_test] [--dbuser=root] [--dbpass=''] [--dbhost=127.0.0.1] [--wpversion=latest] [--no-db]" | ||
} | ||
|
||
# Parse command-line arguments | ||
for i in "$@" | ||
do | ||
case $i in | ||
--dbname=*) | ||
DB_NAME="${i#*=}" | ||
shift | ||
;; | ||
--dbuser=*) | ||
DB_USER="${i#*=}" | ||
shift | ||
;; | ||
--dbpass=*) | ||
DB_PASS="${i#*=}" | ||
shift | ||
;; | ||
--dbhost=*) | ||
DB_HOST="${i#*=}" | ||
shift | ||
;; | ||
--wpversion=*) | ||
WP_VERSION="${i#*=}" | ||
shift | ||
;; | ||
--no-db) | ||
SKIP_DB="true" | ||
shift | ||
;; | ||
*) | ||
# unknown option | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
# Run install-wp-tests.sh | ||
echo "Installing local tests into ${TMPDIR}" | ||
bash "$(dirname "$0")/install-wp-tests.sh" "$DB_NAME" "$DB_USER" "$DB_PASS" "$DB_HOST" "$WP_VERSION" "$SKIP_DB" | ||
|
||
# Run PHPUnit | ||
echo "Running PHPUnit" | ||
composer 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
DIRNAME=$(dirname "$0") | ||
|
||
bash "${DIRNAME}/install-wp-tests.sh" wordpress_test root root 127.0.0.1 latest | ||
echo "Running PHPUnit on Single Site" | ||
composer phpunit | ||
rm -rf $WP_TESTS_DIR $WP_CORE_DIR | ||
|
||
bash "${DIRNAME}/install-wp-tests.sh" wordpress_test root root 127.0.0.1 nightly true | ||
echo "Running PHPUnit on Single Site (Nightly WordPress)" | ||
composer phpunit | ||
|
||
bash "${DIRNAME}/install-wp-tests.sh" wordpress_test root root 127.0.0.1 latest true | ||
echo "Running PHPUnit on Multisite" | ||
WP_MULTISITE=1 composer 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
main(){ | ||
export TERMINUS_HIDE_GIT_MODE_WARNING=1 | ||
local DIRNAME=$(dirname "$0") | ||
|
||
if [ -z "${TERMINUS_SITE}" ]; then | ||
echo "TERMINUS_SITE environment variable must be set" | ||
exit 1 | ||
fi | ||
|
||
if ! terminus whoami > /dev/null; then | ||
if [ -z "${TERMINUS_TOKEN}" ]; then | ||
echo "TERMINUS_TOKEN environment variable must be set or terminus already logged in." | ||
exit 1 | ||
fi | ||
terminus auth:login --machine-token="${TERMINUS_TOKEN}" | ||
fi | ||
|
||
# Use find to locate the file with a case-insensitive search | ||
README_FILE_PATH=$(find ${DIRNAME}/.. -iname "readme.txt" -print -quit) | ||
if [[ -z "$README_FILE_PATH" ]]; then | ||
echo "readme.txt not found." | ||
exit 1 | ||
fi | ||
|
||
local TESTED_UP_TO | ||
TESTED_UP_TO=$(grep -i "Tested up to:" "${README_FILE_PATH}" | tr -d '\r\n' | awk -F ': ' '{ print $2 }') | ||
echo "Tested Up To: ${TESTED_UP_TO}" | ||
local FIXTURE_VERSION | ||
FIXTURE_VERSION=$(terminus wp "${TERMINUS_SITE}.dev" -- core version) | ||
echo "Fixture Version: ${FIXTURE_VERSION}" | ||
|
||
if ! php -r "exit(version_compare('${TESTED_UP_TO}', '${FIXTURE_VERSION}'));"; then | ||
echo "${FIXTURE_VERSION} is less than ${TESTED_UP_TO}" | ||
echo "Please update ${TERMINUS_SITE} to at least WordPress ${TESTED_UP_TO}" | ||
exit 1 | ||
fi | ||
} | ||
|
||
main |
Oops, something went wrong.