From aabb7a50590ce9b1c29db023459b9ca527aa955a Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 13 Apr 2017 16:11:04 +0200 Subject: [PATCH 1/3] TASK: Generate multiple reports * As no further calls are made once a call failed. * Therefore call all reports in a single command. --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 70cce9b..ef77fbd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,8 +30,7 @@ lint:coding-guideline: image: php:7.0-alpine stage: test script: - - ./vendor/bin/phpcs -s -n - - ./vendor/bin/phpcs -s -n > result/phpcs-summary.txt + - ./vendor/bin/phpcs -s -n --report-full=result/phpcs-full.txt --report-diff=result/phpcs-diff.txt --report-summary=result/phpcs-summary.txt artifacts: when: on_failure paths: From 7ed37db05ff0a1597e60d7e6c2ff5ab4d244071e Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 13 Apr 2017 16:12:46 +0200 Subject: [PATCH 2/3] TASK: Only generate one report * As second report is not necessary and won't be generated since the first call will return exit > 0 --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef77fbd..b32aa5b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,7 +41,6 @@ lint:php-mass-detection: stage: test script: - ./vendor/bin/phpmd src text phpmd.xml > result/phpmd.txt - - ./vendor/bin/phpmd src html phpmd.xml > result/phpmd.html artifacts: when: on_failure paths: From af43a99bfded63868ebaf64590ea136963566d9e Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 13 Apr 2017 16:13:16 +0200 Subject: [PATCH 3/3] TASK: Use yaml references * Don't repeat yourself. * Make file shorter and easier to read. * Also make it easier to change something. --- .gitlab-ci.yml | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b32aa5b..88d1918 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ sync:github: - cd mirror - git push --mirror ${MIRROR_GIT_URL} -lint:coding-guideline: +lint:coding-guideline: &PHP-LINTING image: php:7.0-alpine stage: test script: @@ -37,34 +37,25 @@ lint:coding-guideline: - result lint:php-mass-detection: - image: php:7.0-alpine - stage: test + <<: *PHP-LINTING script: - ./vendor/bin/phpmd src text phpmd.xml > result/phpmd.txt - artifacts: - when: on_failure - paths: - - result -test:5.6: +test:5.6: &PHP-UNITTESTING image: php:5.6-alpine stage: test script: - ./vendor/bin/phpunit test:7.0: + <<: *PHP-UNITTESTING image: php:7.0-alpine - stage: test - script: - - ./vendor/bin/phpunit test:latest: + <<: *PHP-UNITTESTING image: php:7-alpine - stage: test - script: - - ./vendor/bin/phpunit -test:documentation:syntax: +test:documentation:syntax: &SPHINX-DOCS image: 'danielsiepmann/sphinx:latest' stage: test before_script: @@ -73,18 +64,13 @@ test:documentation:syntax: - make dummy test:documentation:external-links: - image: 'danielsiepmann/sphinx:latest' - stage: test - before_script: - - cd Documentation + <<: *SPHINX-DOCS script: - make linkcheck render:documentation: - image: 'danielsiepmann/sphinx:latest' + <<: *SPHINX-DOCS stage: render - before_script: - - cd Documentation script: - make html artifacts: