Skip to content

Commit

Permalink
[AllBundles] Validate composer.json files
Browse files Browse the repository at this point in the history
  • Loading branch information
acrobat committed Jun 25, 2020
1 parent 483c694 commit ec0161e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .build/validate-composer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

hasFailure=0
packages=$(find "$(pwd)/src/Kunstmaan" -maxdepth 2 -mindepth 2 -type f -name composer.json -exec dirname '{}' \; | sort -n )
for package in $packages; do
echo "- Validating $(basename ${package})"
composer validate --ansi --strict --no-check-lock ${package}/composer.json

exitCode=$?
if [ $exitCode -ne 0 ]; then
hasFailure=$exitCode
fi
done

echo "- Validating main composer.json"
composer validate --ansi --strict --no-check-lock composer.json

exitCode=$?
if [ $hasFailure -ne 0 ] || [ $exitCode -ne 0 ] ; then
exit 1;
fi
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@ src/Kunstmaan/TranslatorBundle/Tests export-ignore
src/Kunstmaan/UserManagementBundle/Tests export-ignore
src/Kunstmaan/UtilitiesBundle/Tests export-ignore
src/Kunstmaan/VotingBundle/Tests export-ignore

.build export-ignore
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ jobs:
- COVERAGE=true
- PHPUNIT_FLAGS="-v --coverage-clover=coverage.clover"

- stage: Test
php: 7.4
env:
- COMPOSER_VALIDATE=true
before_install: skip
install: skip
before_script: skip
script: sh ./.build/validate-composer.sh || exit $?;
after_script: skip

# Validate frontend setup
- stage: Test
language: javascript
Expand Down

0 comments on commit ec0161e

Please sign in to comment.