From 39238155802534f9234835e9fce0fd9c5348221e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 26 Apr 2017 16:26:53 +0300 Subject: [PATCH] ci: check syntax via php first --- .gitlab-ci.yml | 1 + utils/gitlab-ci/php-lint.sh | 3 +++ utils/gitlab-ci/phpmd.sh | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 utils/gitlab-ci/php-lint.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce6be002..b66939c4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ phpmd: image: php:5.6 script: + - sh utils/php-lint.sh - curl -o /usr/bin/phpmd -L http://static.phpmd.org/php/2.6.0/phpmd.phar - chmod +x /usr/bin/phpmd - sh utils/gitlab-ci/phpmd.sh diff --git a/utils/gitlab-ci/php-lint.sh b/utils/gitlab-ci/php-lint.sh new file mode 100644 index 00000000..172abd87 --- /dev/null +++ b/utils/gitlab-ci/php-lint.sh @@ -0,0 +1,3 @@ +#!/bin/sh -e + +exec find . -name "*.php" -not -path "*/lib/*" -print0 | xargs -0 -n1 php -l diff --git a/utils/gitlab-ci/phpmd.sh b/utils/gitlab-ci/phpmd.sh index e5bad474..ec3ec303 100644 --- a/utils/gitlab-ci/phpmd.sh +++ b/utils/gitlab-ci/phpmd.sh @@ -1,7 +1,8 @@ -#!/bin/sh -e +#!/bin/sh -i -e #phpmd include text utils/gitlab-ci/phpmd-ruleset.xml #phpmd classes text utils/gitlab-ci/phpmd-ruleset.xml FILES=$(ls -dm *.php | tr -d " "| tr -d "\n") phpmd $FILES text utils/gitlab-ci/phpmd-ruleset.xml + -- 2.39.5