Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMSP-73] PHP 8.2 compatibility #575

Draft
wants to merge 48 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
85b5841
Update CONTRIBUTING.md (#554)
Nov 28, 2022
e1f391b
[CMS-1033] Fix GH action (#556)
Nov 28, 2022
3a5d50c
Ignore CHANGELOG.md (#560)
Nov 30, 2022
114f326
Make dependabot target develop branch (#561)
Nov 30, 2022
3c17f8e
[BUGS-5309] Fix WordPress.org readme (#562)
jazzsequence Dec 1, 2022
7485025
Rebase on develop
jazzsequence Dec 2, 2022
740805a
bump changelogs
jazzsequence Dec 2, 2022
e2be993
bump versions
jazzsequence Dec 2, 2022
33ae937
add PR link
jazzsequence Dec 2, 2022
00a7de5
add the numbers to the links
jazzsequence Dec 2, 2022
c73d874
Bump qs from 6.5.2 to 6.11.0 (#565)
dependabot[bot] Dec 7, 2022
e0f3e84
Include schema.xml in release distribution (#568)
Jan 10, 2023
6af65e8
Bump dealerdirect/phpcodesniffer-composer-installer from 0.7.2 to 1.0…
dependabot[bot] Jan 18, 2023
9429d75
[CMSP-93] Migrate to GitHub actions (#571)
Jan 31, 2023
f6aac39
Clean up debug code (#572)
Jan 31, 2023
7102e0a
Bump grunt from 1.5.3 to 1.6.1 (#573)
dependabot[bot] Feb 1, 2023
343091d
Bump http-cache-semantics from 4.1.0 to 4.1.1 (#574)
dependabot[bot] Feb 6, 2023
218c784
Test against 8.2, bump min version to 7.4
Mar 10, 2023
fa76adf
phpcs (visibility will be adjust in later commit just want to test 8.2)
Mar 10, 2023
c44c024
try fixing pubkey step
Mar 13, 2023
d62ff75
fix test errors
Mar 13, 2023
d5021b1
more test fixes
Mar 13, 2023
d40091c
might be all of them?
Mar 13, 2023
d060b21
one more..?
Mar 13, 2023
385e563
solarium/solarium 6
Mar 15, 2023
6dc5664
try solarium/solarium 5
Mar 21, 2023
d3e6757
Fix test error
Mar 21, 2023
86d6e06
sudo apt key
Mar 21, 2023
ffb52c1
remove lint dependency for now
Mar 21, 2023
3a9413a
is_solr_up
Mar 21, 2023
0167d59
move into download_and_run
Mar 21, 2023
c747d23
move into run
Mar 21, 2023
6b6fcdb
downgrade solarium
Mar 22, 2023
8d8c50c
adjust test
Mar 23, 2023
80867ed
adjust test
Mar 23, 2023
fd04129
assertStringContainsString
Mar 23, 2023
c6f1f14
fix tests
Mar 23, 2023
a857383
fix tests
Mar 23, 2023
7ef4a5f
fix tests
Mar 23, 2023
60dd0df
fix tests
Mar 23, 2023
68e6673
solarium 5 again
Mar 23, 2023
2b03ee4
update symfony/event-dispatcher too
Mar 23, 2023
8e69517
update SOLR_PATH
Mar 23, 2023
183916b
what are solarium 6 errors
Mar 23, 2023
b747e35
6x fixes
Mar 23, 2023
0e94275
try this
Mar 23, 2023
21122ef
reset SOLR_PATH
Mar 23, 2023
411501d
fix lint
Mar 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 0 additions & 123 deletions .circleci/config.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@
/package.json export-ignore
/phpcs.xml.dist export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
/schema.xml export-ignore
/README.md export-ignore
144 changes: 144 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: Lint and Test
on:
push:
branches:
- '**'
schedule:
- cron: "0 0 * * *"

jobs:
lint:
runs-on: ubuntu-latest
container:
image: quay.io/pantheon-public/build-tools-ci:8.x-php8.2
options: --user root
name: Lint

steps:
- name: Checkout code
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: Install dependencies
run: composer install -n --prefer-dist

- name: Run PHP Lint
run: composer phpcs

test-phpunit:
# needs: lint
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10.4
name: PHP Unit tests

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

- name: Start MySQL
run: |
sudo systemctl start mysql

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/vendor
key: test-phpunit-dependencies-{{ checksum "composer.json" }}
restore-keys: test-phpunit-dependencies-{{ checksum "composer.json" }}

- name: Add PUBKEYs
run: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B

- name: Install Extras
run: |
sudo apt-get update
sudo apt-get install subversion

- name: Run install-solr.sh
run: bash bin/install-solr.sh

- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none

- name: Install dependencies
run: composer install

- name: "Run Tests"
run: |
bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 latest
composer phpunit
rm -rf $WP_TESTS_DIR $WP_CORE_DIR
bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 nightly true
WP_MULTISITE=1 composer phpunit

test-behat:
needs: test-phpunit
runs-on: ubuntu-latest
container:
image: quay.io/pantheon-public/build-tools-ci:8.x-php8.2
options: --user root
env:
TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TERMINUS_ENV: ci-${{github.run_number}}
TERMINUS_SITE: solr-power
SITE_ENV: solr-power.ci-${{github.run_number}}
WORDPRESS_ADMIN_USERNAME: pantheon
WORDPRESS_ADMIN_EMAIL: [email protected]
WORDPRESS_ADMIN_PASSWORD: solr-power.ci-${{github.run_number}}
name: Behat tests

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

- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SITE_OWNER_SSH_PRIVATE_KEY }}

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/vendor
key: test-behat-dependencies-{{ checksum "composer.json" }}
restore-keys: test-behat-dependencies-{{ checksum "composer.json" }}

- name: Check for $GITHUB_TOKEN
run: |
if [ -z "$GITHUB_TOKEN" ]; then
echo "GITHUB_TOKEN environment variables missing; assuming unauthenticated build"
exit 0
fi
echo "Setting GitHub OAuth token with suppressed ouput"
{
composer config -g github-oauth.github.com $GITHUB_TOKEN
} &> /dev/null

- name: Check for $TERMINUS_TOKEN
run: |
if [ -z "$TERMINUS_TOKEN" ]; then
echo "TERMINUS_TOKEN environment variables missing; assuming unauthenticated build"
exit 0
fi
terminus auth:login --machine-token=$TERMINUS_TOKEN

- name: Prepare for Behat tests
run: ./bin/behat-prepare.sh

- name: Execute Behat tests
run: ./bin/behat-test.sh --strict

- name: Clean up Behat tests
run: ./bin/behat-cleanup.sh
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog ##

## 2.4.2 (December 2, 2022) ##
* Re-add changelog heading to readme.txt [[#564](https://github.com/pantheon-systems/solr-power/pull/564)]

## 2.4.1 (December 1, 2022) ##
* Fixes the WordPress `readme.txt` [[#562](https://github.com/pantheon-systems/solr-power/pull/562/)]

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Requires at least:** 4.6
**Requires PHP:** 7.1
**Tested up to:** 6.0
**Stable tag:** 2.4.1
**Stable tag:** 2.4.2
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand Down
20 changes: 17 additions & 3 deletions bin/behat-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ fi

set -ex

# Set StrictHostKeyChecking to no
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config

###
# Create a new environment for this particular test run.
###
Expand Down Expand Up @@ -51,7 +54,20 @@ git clone -b $TERMINUS_ENV $PANTHEON_GIT_URL $PREPARE_DIR
rm -rf $PREPARE_DIR/wp-content/plugins/solr-power
cd $BASH_DIR/..
rsync -av --exclude='node_modules/' --exclude='tests/' ./* $PREPARE_DIR/wp-content/plugins/solr-power
cd $PREPARE_DIR/wp-content/plugins/solr-power

###
# Build plugin
###
npm ci
npm run build
composer install --no-dev -o

# Remove unneeded stuff
rm -rf $PREPARE_DIR/wp-content/plugins/solr-power/.git
rm -rf $PREPARE_DIR/wp-content/plugins/solr-power/node_modules/
rm -rf $PREPARE_DIR/wp-content/plugins/solr-power/tests/
cd $BASH_DIR/..

# Download the latest Classic Editor release from WordPress.org
wget -O $PREPARE_DIR/classic-editor.zip https://downloads.wordpress.org/plugin/classic-editor.zip
Expand All @@ -75,9 +91,7 @@ terminus build:workflow:wait $TERMINUS_SITE.$TERMINUS_ENV
###
# Set up WordPress, theme, and plugins for the test run
###
{
terminus wp $SITE_ENV -- core install --title=$TERMINUS_ENV-$TERMINUS_SITE --url=$PANTHEON_SITE_URL --admin_user=$WORDPRESS_ADMIN_USERNAME --admin_email=$WORDPRESS_ADMIN_EMAIL --admin_password=$WORDPRESS_ADMIN_PASSWORD
} &> /dev/null
terminus wp $SITE_ENV -- core install --title=$TERMINUS_ENV-$TERMINUS_SITE --url=$PANTHEON_SITE_URL --admin_user=$WORDPRESS_ADMIN_USERNAME --admin_email=$WORDPRESS_ADMIN_EMAIL --admin_password=$WORDPRESS_ADMIN_PASSWORD
terminus wp $SITE_ENV -- plugin activate solr-power classic-editor
terminus wp $SITE_ENV -- theme activate twentyseventeen
terminus wp $SITE_ENV -- rewrite structure '/%year%/%monthnum%/%day%/%postname%/'
4 changes: 4 additions & 0 deletions bin/behat-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ set -ex

export BEHAT_PARAMS='{"extensions" : {"Behat\\MinkExtension" : {"base_url" : "http://'$TERMINUS_ENV'-'$TERMINUS_SITE'.pantheonsite.io"} }}'

###
# Install dependencies for tests
###
composer install
./vendor/bin/behat "$@"
1 change: 1 addition & 0 deletions bin/install-solr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ run() {
else
java -Djetty.port=$SOLR_PORT -jar start.jar > /dev/null 2>&1 &
fi
is_solr_up
wait_for_solr
cd ../../
echo "Started"
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
"prefer-stable": true,
"config": {
"platform": {
"php": "7.1"
"php": "7.3"
},
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"require": {
"solarium/solarium": "~4",
"symfony/event-dispatcher": "^3.4"
"solarium/solarium": "~6",
"symfony/event-dispatcher": "^4.3 || ^5.0 || ^6.0"
},
"require-dev": {
"pantheon-systems/pantheon-wordpress-upstream-tests": "dev-master",
"wp-coding-standards/wpcs": "^2.1",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"phpunit/phpunit": "^6 || ^7",
"wp-coding-standards/wpcs": "dev-develop as 2.3.1",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"phpunit/phpunit": "^9",
"phpcompatibility/php-compatibility": "^9.3",
"yoast/phpunit-polyfills": "^1.0"
},
Expand Down
Loading