Skip to content
Snippets Groups Projects
Verified Commit 763f39be authored by David Beniamine's avatar David Beniamine
Browse files

Use docker-compose to launch pre-commit tests

parent 5cf3e548
No related branches found
No related tags found
No related merge requests found
......@@ -4,9 +4,14 @@ REDBOLD='\033[0;31;1m'
GREENBOLD='\033[0;32;1m'
BOLD='\033[1m'
NORMAL='\033[0m'
if [ ! -z "$(which docker-compose)" ]; then
composer="docker-compose -f ../docker-compose.yml exec -T memorekall-member composer"
else
composer=composer
fi
echo -e "\n ${BOLD} Starting Unit and Functional Tests...\n ${NORMAL}"
composer tests
$composer tests
if [ $? != 0 ]; then
echo -e "\n ${REDBOLD} Unit tests failed \n ${NORMAL}"
exit 1;
......@@ -15,7 +20,7 @@ else
fi
echo -e "\n ${BOLD} Starting PHP_CodeSniffer... \n ${NORMAL}"
composer phpcs
$composer phpcs
if [ $? != 0 ]; then
echo -e "\n ${REDBOLD} PHPCS verification failed \n ${NORMAL}"
exit 1;
......@@ -24,7 +29,7 @@ else
fi
echo -e "\n ${BOLD} Starting PHPStan... \n ${NORMAL}"
composer phpstan
$composer phpstan
if [ $? != 0 ]; then
echo -e "\n ${REDBOLD} PHPStan verification failed \n ${NORMAL}"
exit 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment