Skip to content

Commit

Permalink
Merge branch 'develop' into cmsp-480-vdp-readme-update
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence authored Sep 19, 2023
2 parents a069a54 + 49e3b28 commit f1073e8
Show file tree
Hide file tree
Showing 19 changed files with 465 additions and 284 deletions.
27 changes: 6 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ workflows:
version: 2
main:
jobs:
- lint
- test-behat
- test-phpunit-74
- test-phpunit-82
Expand All @@ -18,25 +17,8 @@ workflows:
jobs:
- test-behat
jobs:
lint:
working_directory: ~/pantheon-systems/wp-native-php-sessions
docker:
- image: quay.io/pantheon-public/build-tools-ci:8.x-php8.0
steps:
- checkout
- restore_cache:
keys:
- test-lint-dependencies-{{ checksum "composer.json" }}
- run: composer install -n --prefer-dist
- save_cache:
key: test-lint-dependencies-{{ checksum "composer.json" }}
paths:
- vendor
- run:
name: "Run PHP Lint"
command: |
composer phpcs
test-behat:
resource_class: small
working_directory: ~/pantheon-systems/wp-native-php-sessions
parallelism: 1
docker:
Expand Down Expand Up @@ -76,16 +58,18 @@ jobs:
exit 0
fi
terminus auth:login --machine-token=$TERMINUS_TOKEN
- run: ./bin/validate-fixture-version.sh
- run: ./bin/behat-prepare.sh
- run: ./bin/behat-test.sh --strict
- run:
command: ./bin/behat-cleanup.sh
when: always
test-phpunit-74:
resource_class: small
working_directory: ~/pantheon-systems/wp-native-php-sessions
docker:
- image: circleci/php:7.4-node-browsers
- image: circleci/mariadb:10.3
- image: cimg/mariadb:10.3
environment:
- WP_TESTS_DIR: "/tmp/wordpress-tests-lib"
- WP_CORE_DIR: "/tmp/wordpress/"
Expand Down Expand Up @@ -120,10 +104,11 @@ jobs:
bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 nightly true
composer phpunit
test-phpunit-82:
resource_class: small
working_directory: ~/pantheon-systems/wp-native-php-sessions
docker:
- image: cimg/php:8.2.0
- image: circleci/mariadb:10.3
- image: cimg/mariadb:10.3
environment:
- WP_TESTS_DIR: "/tmp/wordpress-tests-lib"
- WP_CORE_DIR: "/tmp/wordpress/"
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Linting & Test
on: [push]
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
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint and Test
on: push

jobs:
lint:
runs-on: ubuntu-latest
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: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
- name: Install dependencies
run: composer install -n --prefer-dist
- name: Run PHP Lint
run: composer phpcs
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
**Contributors:** [getpantheon](https://profiles.wordpress.org/getpantheon), [outlandish josh](https://profiles.wordpress.org/outlandish-josh), [mpvanwinkle77](https://profiles.wordpress.org/mpvanwinkle77), [danielbachhuber](https://profiles.wordpress.org/danielbachhuber), [andrew.taylor](https://profiles.wordpress.org/andrew.taylor), [jazzs3quence](https://profiles.wordpress.org/jazzs3quence), [stovak](https://profiles.wordpress.org/stovak), [jspellman](https://profiles.wordpress.org/jspellman/)
**Tags:** comments, sessions
**Requires at least:** 4.7
**Tested up to:** 6.2.2
**Tested up to:** 6.3
**Stable tag:** 1.3.7-dev
**Requires PHP:** 5.4
**License:** GPLv2 or later
Expand All @@ -13,7 +13,7 @@ Use native PHP sessions and stay horizontally scalable. Better living through su
## Description ##

[![Actively Maintained](https://img.shields.io/badge/Pantheon-Actively_Maintained-yellow?logo=pantheon&color=FFDC28)](https://pantheon.io/docs/oss-support-levels#actively-maintained-support)
[![CircleCI](https://circleci.com/gh/pantheon-systems/wp-native-php-sessions/tree/master.svg?style=svg)](https://circleci.com/gh/pantheon-systems/wp-native-php-sessions/tree/master)
[![CircleCI](https://circleci.com/gh/pantheon-systems/wp-native-php-sessions/tree/main.svg?style=svg)](https://circleci.com/gh/pantheon-systems/wp-native-php-sessions/tree/main)

WordPress core does not use PHP sessions, but sometimes they are required by your use-case, a plugin or theme.

Expand Down Expand Up @@ -76,6 +76,7 @@ This mu-plugin will load WP Native PHP Sessions before all other plugins, while
## Changelog ##

### 1.3.7-dev ###
* Updates Pantheon WP Coding Standards to 2.0 [[#264](https://github.com/pantheon-systems/wp-native-php-sessions/pull/264)]

### 1.3.6 (June 1, 2023) ###
* Fixes PHP 8.2 deprecated dynamic property error [[#251](https://github.com/pantheon-systems/wp-native-php-sessions/pull/251)] (props @miguelaxcar)
Expand Down
10 changes: 2 additions & 8 deletions bin/behat-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ cd $BASH_DIR/..
rsync -av --exclude='vendor/' --exclude='node_modules/' --exclude='tests/' ./* $PREPARE_DIR/wp-content/plugins/wp-native-php-sessions
rm -rf $PREPARE_DIR/wp-content/plugins/wp-native-php-sessions/.git

# Download the latest Classic Editor release from WordPress.org
wget -O $PREPARE_DIR/classic-editor.zip https://downloads.wordpress.org/plugin/classic-editor.zip
unzip $PREPARE_DIR/classic-editor.zip -d $PREPARE_DIR
mv $PREPARE_DIR/classic-editor $PREPARE_DIR/wp-content/plugins/
rm $PREPARE_DIR/classic-editor.zip

###
# Add the debugging plugin to the environment
###
Expand All @@ -85,6 +79,6 @@ terminus build:workflow:wait $TERMINUS_SITE.$TERMINUS_ENV
{
terminus wp $SITE_ENV -- core install --title=$TERMINUS_ENV-$TERMINUS_SITE --url=$PANTHEON_SITE_URL --admin_user=$WORDPRESS_ADMIN_USERNAME --admin_email=wp-native-php-sessions@getpantheon.com --admin_password=$WORDPRESS_ADMIN_PASSWORD
} &> /dev/null
terminus wp $SITE_ENV -- plugin activate wp-native-php-sessions classic-editor
terminus wp $SITE_ENV -- theme activate twentyseventeen
terminus wp $SITE_ENV -- plugin activate wp-native-php-sessions
terminus wp $SITE_ENV -- theme activate twentytwentythree
terminus wp $SITE_ENV -- rewrite structure '/%year%/%monthnum%/%day%/%postname%/'
43 changes: 43 additions & 0 deletions bin/validate-fixture-version.sh
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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
],
"require-dev": {
"pantheon-systems/pantheon-wordpress-upstream-tests": "dev-master",
"pantheon-systems/pantheon-wp-coding-standards": "^1.0",
"pantheon-systems/pantheon-wp-coding-standards": "^2.0",
"phpunit/phpunit": "^9",
"yoast/phpunit-polyfills": "^1.0"
"yoast/phpunit-polyfills": "^2.0"
},
"scripts": {
"lint": "@phpcs",
Expand Down
Loading

0 comments on commit f1073e8

Please sign in to comment.