mirror of
https://github.com/tim-krehan/shopping-list.git
synced 2024-11-23 22:30:41 +01:00
Merge branch 'ci-test' into 'develop'
CI Syntaxchecks See merge request bluekay/shopping-list!7
This commit is contained in:
commit
0dfe45acab
2 changed files with 37 additions and 0 deletions
9
.gitlab-ci.yml
Normal file
9
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
stages:
|
||||
- test
|
||||
|
||||
check_code:
|
||||
stage: test
|
||||
script:
|
||||
- ./.test/php_syntax.sh
|
||||
tags:
|
||||
- php
|
28
.test/php_syntax.sh
Executable file
28
.test/php_syntax.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
PHP=/usr/bin/php
|
||||
|
||||
COUNT=0
|
||||
HIT=0
|
||||
|
||||
cd ..
|
||||
|
||||
for file in `find . -name \*.php`; do
|
||||
OUTPUT=`$PHP -l $file`
|
||||
if ! [ 0 = $? ]; then
|
||||
echo $OUTPUT
|
||||
HIT=$(($HIT+1))
|
||||
fi
|
||||
COUNT=$(($COUNT+1))
|
||||
done
|
||||
|
||||
|
||||
if ! [ 0 = $HIT ]; then
|
||||
echo "Syntax check: FAILED"
|
||||
echo "Checked Files: $COUNT, Files with Errors: $HIT"
|
||||
exit 1
|
||||
else
|
||||
echo "Syntax check: PASSED"
|
||||
echo "Checked Files: $COUNT"
|
||||
exit 0
|
||||
fi
|
Loading…
Reference in a new issue