From f812769c15fbcd9ff782c06fc9c16e686db7d1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Uzna=C5=84ski?= Date: Sat, 5 Sep 2020 12:37:50 +0200 Subject: [PATCH] [TASK] Add lint stage in gitlab ci (#82) --- .gitlab-ci.yml | 55 +++++++++++++++++++++++++++++++++ .gitlab/build/docker_install.sh | 4 +-- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 93072b6..680255b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - build - code_quality + - lint - test include: @@ -16,6 +17,7 @@ default: build-composer-dependencies: stage: build + needs: [] variables: COMPOSER_CACHE_DIR: '.composer' script: @@ -33,9 +35,62 @@ build-composer-dependencies: phpcs: stage: code_quality + needs: + - build-composer-dependencies script: - composer ci:php:sniff +php-lint-php7.2: + image: php:7.2 + stage: lint + needs: [] + script: + - composer ci:php:lint + +php-lint-php7.3: + image: php:7.3 + stage: lint + needs: [] + script: + - composer ci:php:lint + +php-lint-php7.4: + image: php:7.4 + stage: lint + needs: [] + script: + - composer ci:php:lint + +ts-lint: + stage: lint + needs: + - build-composer-dependencies + script: + - composer ci:ts:lint + +json-lint: + stage: lint + needs: + - build-composer-dependencies + script: + - composer ci:json:lint + +yaml-lint: + stage: lint + needs: + - build-composer-dependencies + script: + - composer ci:yaml:lint + +xliff-lint: + stage: lint + needs: + - build-composer-dependencies + script: + - wget https://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd + - xmllint --schema ./xliff-core-1.2-strict.xsd + --noout $(find Resources -name '*.xlf') + code_quality: before_script: [] diff --git a/.gitlab/build/docker_install.sh b/.gitlab/build/docker_install.sh index bb7ddcf..885f4c9 100644 --- a/.gitlab/build/docker_install.sh +++ b/.gitlab/build/docker_install.sh @@ -5,9 +5,9 @@ set -xe apt-get update -yqq -apt-get install git libzip-dev unzip -yqq +apt-get install git libzip-dev unzip libxml2-utils wget -yqq php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/local/bin/ --filename=composer chmod +x /usr/local/bin/composer -docker-php-ext-install zip \ No newline at end of file +docker-php-ext-install zip