Skip to content

Commit 6fd4a99

Browse files
authored
Merge pull request #339 from Ultimate-Multisite/fix/e2e-optional-addon-plugins
fix: filter missing addon plugins in e2e wp-env setup
2 parents cbec588 + 0bef932 commit 6fd4a99

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,25 @@ jobs:
5656
- name: Install Composer dependencies
5757
run: composer install
5858

59-
- name: Set PHP version for wp-env
59+
- name: Set PHP version and filter missing plugins for wp-env
6060
run: |
61-
echo "{\"config\": {\"phpVersion\": \"${{ matrix.php }}\"}}" > .wp-env.override.json
61+
node -e "
62+
const fs = require('fs');
63+
const path = require('path');
64+
const config = JSON.parse(fs.readFileSync('.wp-env.json', 'utf8'));
65+
const override = { config: { phpVersion: '${{ matrix.php }}' }, env: {} };
66+
for (const [envName, envConfig] of Object.entries(config.env || {})) {
67+
if (envConfig.plugins) {
68+
const existing = envConfig.plugins.filter(p => {
69+
const resolved = path.resolve(p);
70+
return fs.existsSync(resolved);
71+
});
72+
override.env[envName] = { plugins: existing };
73+
}
74+
}
75+
fs.writeFileSync('.wp-env.override.json', JSON.stringify(override, null, 2));
76+
console.log('Override:', JSON.stringify(override, null, 2));
77+
"
6278
6379
- name: Start WordPress Test Environment
6480
run: npm run env:start:test

0 commit comments

Comments
 (0)