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

[BUGS-7135]: Updates code to resolve auth issue. #359

Merged
merged 14 commits into from
Nov 22, 2023
Merged
31 changes: 1 addition & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,18 @@ workflows:
version: 2
main:
jobs:
- lint
- test-behat:
requires:
- lint
- test-behat
- test-phpunit:
name: "Test with PHP 7.4"
requires:
- lint
php_version: "7.4"
- test-phpunit:
name: "Test with PHP 8.0"
requires:
- lint
php_version: "8.0"
- test-phpunit:
name: "Test with PHP 8.1"
requires:
- lint
php_version: "8.1"
- test-phpunit:
name: "Test with PHP 8.2"
requires:
- lint
php_version: "8.2"
nightly:
triggers:
Expand All @@ -38,24 +27,6 @@ workflows:
jobs:
- test-behat
jobs:
lint:
working_directory: ~/pantheon-systems/wp-saml-auth
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:
working_directory: ~/pantheon-systems/wp-saml-auth
parallelism: 1
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ jobs:
uses: pantheon-systems/[email protected]
with:
type: plugin
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Lint
run: |
composer install
composer lint
4 changes: 4 additions & 0 deletions bin/behat-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ git clone -b $TERMINUS_ENV $PANTHEON_GIT_URL $PREPARE_DIR
###
# Add WP Native PHP Sessions and child theme to environment
###
echo "Creating a child theme called $TERMINUS_SITE"
rm -rf $PREPARE_DIR/wp-content/themes/$TERMINUS_SITE
# Create a child theme that includes WP SAML Auth configuration details
mkdir $PREPARE_DIR/wp-content/themes/$TERMINUS_SITE
cp $BASH_DIR/fixtures/functions.php $PREPARE_DIR/wp-content/themes/$TERMINUS_SITE/functions.php
cp $BASH_DIR/fixtures/style.css $PREPARE_DIR/wp-content/themes/$TERMINUS_SITE/style.css

echo "Adding WP Native PHP Sessions to the environment"
rm -rf $PREPARE_DIR/wp-content/plugins/wp-native-php-sessions
# Download the latest WP Native PHP sessions release from WordPress.org
wget -O $PREPARE_DIR/wp-native-php-sessions.zip https://downloads.wordpress.org/plugin/wp-native-php-sessions.zip
Expand All @@ -59,6 +61,7 @@ rm $PREPARE_DIR/wp-native-php-sessions.zip
###
# Add the copy of this plugin itself to the environment
###
echo "Copying WP SAML Auth into WordPress"
cd $BASH_DIR/..
rsync -av --exclude='node_modules/' --exclude='simplesamlphp/' --exclude='tests/' ./* $PREPARE_DIR/wp-content/plugins/wp-saml-auth
rm -rf $PREPARE_DIR/wp-content/plugins/wp-saml-auth/.git
Expand All @@ -68,6 +71,7 @@ rm -rf $PREPARE_DIR/wp-content/plugins/wp-saml-auth/.git
# SimpleSAMLphp is installed to ~/code/private, and then symlinked into the
# web root
###
echo "Setting up SimpleSAMLphp"
rm -rf $PREPARE_DIR/private
mkdir $PREPARE_DIR/private
wget https://github.com/simplesamlphp/simplesamlphp/releases/download/v1.18.4/simplesamlphp-1.18.4.tar.gz -O $PREPARE_DIR/simplesamlphp-latest.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions bin/fixtures/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
add_action( 'wp_enqueue_scripts', 'samltheme_parent_theme_enqueue_styles' );

function samltheme_parent_theme_enqueue_styles() {
wp_enqueue_style( 'twentytwentythree-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'theme-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'samltheme-style',
get_stylesheet_directory_uri() . '/style.css',
array( 'twentytwentythree-style' )
array( 'theme-style' )
);

}
Expand Down
2 changes: 1 addition & 1 deletion bin/fixtures/style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Theme Name: WP SAML Auth
Theme URI: https://pantheon.io
Description: Twentytwentythree child theme.
Description: TwentyTwentyThree child theme.
Author: x
Author URI: https://pantheon.io
Template: twentytwentythree
Expand Down
Loading