Skip to content

Commit 80f8b69

Browse files
committed
Add CI check that wp package explains itself without dev dependencies
Installs the bundle with `--no-dev`, the state Composer-based users end up in, and asserts that `wp package` fails with the hint rather than a bare "not a registered wp command". This guards against the hint metadata being dropped or misnested, and against the framework renaming the `extra` key it reads. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G27BNpnRNerEeSGjvefzBf
1 parent 4f180f8 commit 80f8b69

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎.github/workflows/testing.yml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,34 @@ jobs:
1414
test:
1515
uses: wp-cli/.github/.github/workflows/reusable-testing.yml@main
1616

17+
package-command-guidance:
18+
name: Guidance for `wp package` without dev dependencies
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out source code
22+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23+
with:
24+
persist-credentials: false
25+
26+
- name: Set up PHP environment
27+
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
28+
with:
29+
php-version: 'latest'
30+
coverage: none
31+
32+
- name: Install without dev dependencies
33+
run: composer install --no-dev --no-interaction --prefer-dist
34+
35+
- name: Check that `wp package` points at package-command
36+
run: |
37+
if vendor/bin/wp package > stdout.txt 2> stderr.txt; then
38+
echo 'Expected `wp package` to fail without wp-cli/package-command.'
39+
exit 1
40+
fi
41+
42+
cat stderr.txt
43+
grep -qF 'composer require wp-cli/package-command' stderr.txt
44+
1745
minimum-php-guard:
1846
name: Minimum PHP guard - PHP ${{ matrix.php }}
1947
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)