Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
4 changes: 3 additions & 1 deletion .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ jobs:
php-version: 8.3
- name: Install dependencies
run: composer install -n --prefer-dist
- name: Run PHPCS
- name: Lint
run: composer lint
- name: Codesniffer
run: composer phpcs
php8-compatibility:
name: PHP 8.x Compatibility
runs-on: ubuntu-latest
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/test-behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ name: Behat CI

on:
push:
branches: [ master, main ]
branches: [ develop, main, release ]
pull_request:
workflow_dispatch:
schedule:
# Nightly at 00:00 UTC (CircleCI had cron "0 0 * * *" with branch filter=master)
- cron: "0 0 * * *"

permissions:
contents: read
Expand All @@ -20,10 +17,16 @@ jobs:

runs-on: ubuntu-latest

strategy:
matrix:
php-version: ['7.4', '8.1', '8.3']
fail-fast: false

env:
RUN_NUM: ${{ github.run_number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }}
PHP_VERSION_OVERRIDE: ${{ matrix.php-version }}

steps:
- name: Checkout
Expand All @@ -41,9 +44,6 @@ jobs:
- name: Install dependencies
run: composer install -n --prefer-dist

- name: Run PHP Lint
run: composer phpcs

- name: Install Terminus
uses: pantheon-systems/terminus-github-actions@v1
with:
Expand All @@ -62,10 +62,11 @@ jobs:

- name: Export env
run: |
PHP_VERSION_CLEAN=$(echo "${{ matrix.php-version }}" | tr -d '.')
{
echo "TERMINUS_ENV=ci-${RUN_NUM}"
echo "TERMINUS_ENV=ci-${RUN_NUM}-php${PHP_VERSION_CLEAN}"
echo "TERMINUS_SITE=wp-native-php-sessions"
echo "SITE_ENV=wp-native-php-sessions.ci-${RUN_NUM}"
echo "SITE_ENV=wp-native-php-sessions.ci-${RUN_NUM}-php${PHP_VERSION_CLEAN}"
echo "WORDPRESS_ADMIN_USERNAME=pantheon"
echo "WORDPRESS_ADMIN_EMAIL=no-reply@getpantheon.com"
echo "WORDPRESS_ADMIN_PASSWORD=$(cat /tmp/WORDPRESS_ADMIN_PASSWORD)"
Expand Down
25 changes: 23 additions & 2 deletions bin/behat-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,33 @@ rm -rf "$PREPARE_DIR"/wp-content/mu-plugins/sessions-debug.php
cp "$BASH_DIR"/fixtures/sessions-debug.php "$PREPARE_DIR"/wp-content/mu-plugins/sessions-debug.php

###
# Push files to the environment
# Configure PHP version if specified
###
cd "$PREPARE_DIR"
git add wp-content
git config user.email "wp-native-php-sessions@getpantheon.com"
git config user.name "Pantheon"

if [ -n "${PHP_VERSION_OVERRIDE:-}" ]; then
echo "Setting PHP version to: $PHP_VERSION_OVERRIDE"

# Check current PHP version in pantheon.yml
CURRENT_PHP_VERSION=$(grep "^php_version:" pantheon.yml | cut -d' ' -f2)

if [ "$CURRENT_PHP_VERSION" != "$PHP_VERSION_OVERRIDE" ]; then
# Update the existing pantheon.yml file with the new PHP version
sed -i.bak "s/^php_version:.*/php_version: $PHP_VERSION_OVERRIDE/" pantheon.yml
git add pantheon.yml
git commit -m "Set PHP version to $PHP_VERSION_OVERRIDE"
echo "PHP version changed from $CURRENT_PHP_VERSION to $PHP_VERSION_OVERRIDE"
else
echo "PHP version already set to $PHP_VERSION_OVERRIDE, no change needed"
fi
fi

###
# Push files to the environment
###
git add wp-content
git commit -m "Include WP Native PHP Sessions and its configuration files"
git push

Expand Down