Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ jobs:
name: 'Check coding standard'
run: 'bin/phing create-dirs cs || cat build/log/phpcs-checkstyle.xml | cs2pr'

composer-require-checker:
name: 'Composer require check'
composer-dependencies:
name: 'Composer dependencies'
needs: 'lint'
runs-on: 'ubuntu-latest'

Expand All @@ -123,8 +123,8 @@ jobs:
with:
dependency-versions: 'highest'
-
name: 'Check missing Composer requires'
run: 'bin/phing composer-require-checker'
name: 'Analyze Composer dependencies'
run: 'bin/phing composer-dependencies'

tests:
name: 'Tests - PHP ${{ matrix.php-version }}, ${{ matrix.composer-dependencies }} dependencies'
Expand Down
15 changes: 10 additions & 5 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
<property file="${path.build.properties.local}"/>

<property name="file.mode.writable" value="0775"/>

<property name="path.bin" value="${path.root}/bin"/>
<property name="path.build.log" value="${path.build}/log"/>
<property name="path.composer.executable" value="composer"/>
<property name="path.composer-require-checker.executable" value="${path.bin}/composer-require-checker"/>
<property name="path.composer-dependency-analyser.config" value="${path.build}/composer-dependency-analyser.config.php"/>
<property name="path.composer-dependency-analyser.executable" value="${path.bin}/composer-dependency-analyser"/>
<property name="path.phpcs.executable" value="${path.bin}/phpcs"/>
<property name="path.phpcs.ruleset" value="${path.build}/cs-ruleset.xml"/>
<property name="path.phplint.executable" value="${path.bin}/parallel-lint"/>
Expand All @@ -29,7 +31,7 @@
phplint,
cs,
tests,
composer-require-checker
composer-dependencies
"/>

<target name="composer" depends="composer-validate">
Expand All @@ -43,13 +45,15 @@
</exec>
</target>

<target name="composer-require-checker">
<target name="composer-dependencies">
<exec
executable="${path.composer-require-checker.executable}"
executable="${path.composer-dependency-analyser.executable}"
logoutput="true"
passthru="true"
checkreturn="true"
/>
>
<arg value="--config=${path.composer-dependency-analyser.config}"/>
</exec>
</target>

<target name="composer-validate">
Expand Down Expand Up @@ -81,6 +85,7 @@
<arg value="--report=full"/>
<arg value="--report-checkstyle=${path.build.log}/phpcs-checkstyle.xml"/>
<arg value="-sp"/>
<arg path="${path.build}"/>
<arg path="${path.src}"/>
<arg path="${path.tests}"/>
</exec>
Expand Down
20 changes: 20 additions & 0 deletions build/composer-dependency-analyser.config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types = 1);

use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;

$config = new Configuration();

$config = $config->enableAnalysisOfUnusedDevDependencies();
$config = $config->addPathToScan(__DIR__, true);

// tools
$config = $config->ignoreErrorsOnPackages([
'consistence/coding-standard',
'php-parallel-lint/php-console-highlighter',
'php-parallel-lint/php-parallel-lint',
], [ErrorType::UNUSED_DEPENDENCY]);

return $config;
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
},
"require-dev": {
"consistence/coding-standard": "3.10.1",
"maglnet/composer-require-checker": "2.0",
"php-parallel-lint/php-console-highlighter": "1.0",
"php-parallel-lint/php-parallel-lint": "1.3.2",
"phpunit/phpunit": "8.5.25",
"vasek-purchart/phing-tester": "2.1"
"vasek-purchart/phing-tester": "2.1",
"shipmonk/composer-dependency-analyser": "1.8.1"
},
"autoload": {
"psr-4": {
Expand Down
Loading