Skip to content

Commit a620d9d

Browse files
dd32claude
andcommitted
Fix CI: GlotPress directory casing and npm cache conflict
- Update bootstrap.php to detect GlotPress directory name case-insensitively (wp-env installs as 'GlotPress' not 'glotpress') - Use --force flag for npm install to avoid EEXIST cache errors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c1b9554 commit a620d9d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
composer-options: "--no-progress --no-ansi --no-interaction"
3737

3838
- name: Install wp-env
39-
run: npm -g install @wordpress/env
39+
run: npm -g install @wordpress/env --force
4040

4141
- name: Override PHP version
4242
run: echo '{ "phpVersion":"${{ matrix.php }}" }' > .wp-env.override.json

tests/bootstrap.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@
88
}
99

1010
function _glotpress_path( string $path ): string {
11-
$glotpress_path = dirname( __DIR__, 2 ) . '/glotpress/';
12-
if ( getenv( 'GITHUB_ACTIONS' ) ) {
13-
$glotpress_path = '/tmp/wordpress/wp-content/plugins/glotpress/';
11+
$plugins_dir = dirname( __DIR__, 2 );
12+
13+
// GlotPress may be installed as 'glotpress' or 'GlotPress' depending on the environment.
14+
foreach ( array( 'glotpress', 'GlotPress' ) as $dir_name ) {
15+
if ( is_dir( $plugins_dir . '/' . $dir_name ) ) {
16+
return $plugins_dir . '/' . $dir_name . '/' . $path;
17+
}
1418
}
1519

16-
return $glotpress_path . $path;
20+
// Fallback to lowercase.
21+
return $plugins_dir . '/glotpress/' . $path;
1722
}
1823

1924
// Forward custom PHPUnit Polyfills configuration to PHPUnit bootstrap file.

0 commit comments

Comments
 (0)