Skip to content

Commit be5e0c1

Browse files
committed
Composer Require Checker
1 parent 34e2bfd commit be5e0c1

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,33 @@ jobs:
9999
name: 'Check coding standard'
100100
run: 'bin/phing create-dirs cs || cat build/log/phpcs-checkstyle.xml | cs2pr'
101101

102+
composer-require-checker:
103+
name: 'Composer require check'
104+
needs: 'lint'
105+
runs-on: 'ubuntu-latest'
106+
107+
steps:
108+
-
109+
name: 'Checkout'
110+
uses: 'actions/checkout@v3.3.0'
111+
-
112+
name: 'Setup PHP ${{ env.CONSISTENCE_PHP_VERSION }}'
113+
uses: 'shivammathur/setup-php@2.24.0'
114+
with:
115+
php-version: '${{ env.CONSISTENCE_PHP_VERSION }}'
116+
coverage: 'none'
117+
-
118+
name: 'Setup problem matchers for PHP'
119+
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"'
120+
-
121+
name: 'Composer install'
122+
uses: 'ramsey/composer-install@2.2.0'
123+
with:
124+
dependency-versions: 'highest'
125+
-
126+
name: 'Check missing Composer requires'
127+
run: 'bin/phing composer-require-checker'
128+
102129
tests:
103130
name: 'Tests - PHP ${{ matrix.php-version }}, ${{ matrix.composer-dependencies }} dependencies'
104131
needs: 'lint'

build.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<property name="path.bin" value="${path.root}/bin"/>
1111
<property name="path.build.log" value="${path.build}/log"/>
1212
<property name="path.composer.executable" value="composer"/>
13+
<property name="path.composer-require-checker.executable" value="${path.bin}/composer-require-checker"/>
1314
<property name="path.phpcs.executable" value="${path.bin}/phpcs"/>
1415
<property name="path.phpcs.ruleset" value="${path.build}/cs-ruleset.xml"/>
1516
<property name="path.phplint.executable" value="${path.bin}/parallel-lint"/>
@@ -27,7 +28,8 @@
2728
composer,
2829
phplint,
2930
cs,
30-
tests
31+
tests,
32+
composer-require-checker
3133
"/>
3234

3335
<target name="composer" depends="composer-validate">
@@ -41,6 +43,15 @@
4143
</exec>
4244
</target>
4345

46+
<target name="composer-require-checker">
47+
<exec
48+
executable="${path.composer-require-checker.executable}"
49+
logoutput="true"
50+
passthru="true"
51+
checkreturn="true"
52+
/>
53+
</target>
54+
4455
<target name="composer-validate">
4556
<exec
4657
executable="${path.composer.executable}"

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"require-dev": {
1818
"consistence/coding-standard": "3.10.1",
19+
"maglnet/composer-require-checker": "2.0",
1920
"php-parallel-lint/php-console-highlighter": "1.0",
2021
"php-parallel-lint/php-parallel-lint": "1.3.2",
2122
"phpunit/phpunit": "8.5.25",

0 commit comments

Comments
 (0)