Skip to content

Commit

Permalink
Add dependency checker
Browse files Browse the repository at this point in the history
  • Loading branch information
loicsapone committed Jan 14, 2024
1 parent 5385156 commit a03813c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 12 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,30 @@ on:
- 4.x

jobs:
check-dependencies:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none
tools: composer-require-checker, composer-unused

- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}

- name: Composer Require Checker
run: composer-require-checker

- name: Composer Unused
run: composer-unused --excludePackage=symfony/dependency-injection --excludePackage=symfony/property-access

php-cs-fixer:
runs-on: ubuntu-latest

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ install: ## Install project
@$(PHP_CONT) composer install

## —— CI ✨ ————————————————————————————————————————————————————————————————————
ci: static rector test
ci: deps static rector test

deps: ## Check dependencies
@$(PHP_CONT) composer-require-checker
@$(PHP_CONT) composer-unused --excludePackage=symfony/dependency-injection --excludePackage=symfony/property-access

static: ## Run static analysis tools
$(PHP) -d memory_limit=-1 vendor/bin/phpstan analyse
Expand Down
19 changes: 8 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,23 @@
"require": {
"php": ">=8.1",
"ext-simplexml": "*",
"halaxa/json-machine": "^1.1",
"nette/php-generator": "^4.0",
"symfony/console": "^6.1|^7.0",
"symfony/dependency-injection": "^7.0",
"symfony/filesystem": "^6.1|^7.0",
"symfony/property-access": "^6.1|^7.0",
"symfony/http-kernel": "^6.1|^7.0",
"symfony/messenger": "^6.1|^7.0",
"symfony/serializer": "^6.1|^7.0",
"halaxa/json-machine": "^1.1",
"nette/php-generator": "^4.0",
"symfony/string": "^6.1|^7.0"
"symfony/string": "^6.1|^7.0",
"symfony/property-access": "^7.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.13",
"mikey179/vfsstream": "^1.6",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^10.0",
"rector/rector": "^0.15",
"symfony/framework-bundle": "^6.1|^7.0",
"symfony/messenger": "^6.1|^7.0"
},
"suggest": {
"symfony/framework-bundle": "To use the provided bundle.",
"symfony/messenger": "To add support for async processor."
"rector/rector": "^0.15"
},
"autoload": {
"psr-4": { "IQ2i\\DataImporter\\": "src" }
Expand Down
10 changes: 10 additions & 0 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@ RUN set -eux; \
pcntl \
zip \
;

RUN set -eux; \
curl -OL https://github.com/composer-unused/composer-unused/releases/latest/download/composer-unused.phar; \
chmod a+x composer-unused.phar; \
mv composer-unused.phar /usr/local/bin/composer-unused

RUN set -eux; \
curl -OL https://github.com/maglnet/ComposerRequireChecker/releases/latest/download/composer-require-checker.phar; \
chmod a+x composer-require-checker.phar; \
mv composer-require-checker.phar /usr/local/bin/composer-require-checker

0 comments on commit a03813c

Please sign in to comment.