Skip to content

Commit

Permalink
Adding GitHub CI WordPress env compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
zinigor committed Jun 11, 2024
1 parent f437bff commit fece2ca
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions projects/plugins/wpcomsh/tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@

$_tests_dir = getenv( 'WP_TESTS_DIR' );
$_core_dir = getenv( 'WP_CORE_DIR' );
$wp_branch = getenv( 'WP_BRANCH' );

if ( ! $_tests_dir ) {
$_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
if ( $wp_branch ) {
$_tests_dir = '/tmp/wordpress-' . $wp_branch;
} else {
$_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
}
}

if ( ! $_core_dir ) {
$_core_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress/';
if ( $wp_branch ) {
$_core_dir = '/tmp/wordpress-' . $wp_branch . '/src';
} else {
$_core_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress/';
}
}

define( 'IS_ATOMIC', true );
Expand Down

0 comments on commit fece2ca

Please sign in to comment.