From 480bf3b5ca9c87b80ad2c5090dce9e1cf7721a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@irstea.fr> Date: Fri, 10 Jan 2020 10:54:22 +0100 Subject: [PATCH] Teste les configs avec plusieurs versions. --- .gitlab-ci.yml | 48 +++++++++++------------------------------------- .packagist.sh | 5 ----- composer.json | 8 ++++++++ loose.neon | 2 +- phpunit.neon | 6 +++--- symfony.neon | 12 ++++++------ 6 files changed, 29 insertions(+), 52 deletions(-) delete mode 100755 .packagist.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca3d050..f7bd48b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,38 +1,12 @@ -stages: - - test - - deploy - -.test: &test - stage: test - tags: [docker] - image: php:${CI_JOB_NAME}-cli-alpine +include: + - project: pole-is/tools/ci-config + ref: master + file: /php-multiversions-ci.yml + - project: pole-is/tools/ci-config + ref: master + file: /packagist-ci.yml + +test:7.2: + extends: .php-test variables: - COMPOSER_ALLOW_SUPERUSER: "1" - before_script: - - curl -sSL https://github.com/composer/composer/releases/download/1.8.4/composer.phar --output /usr/local/bin/composer - - chmod +x /usr/local/bin/composer - - apk update && apk add unzip git - - php -v - - composer -V - - composer global require hirak/prestissimo - script: - - composer install - cache: - key: composer-cache - paths: - - /root/.composer/cache - -"7.1": - <<: *test - -"7.2": - <<: *test - -"7.3": - <<: *test - -deploy: - stage: deploy - tags: [docker] - image: appropriate/curl - script: ./.packagist.sh + PHP_VERSION: "7.2" diff --git a/.packagist.sh b/.packagist.sh deleted file mode 100755 index a4d7718..0000000 --- a/.packagist.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env sh -curl -fsSL \ - -H"Content-Type: application/json" \ - -d'{"repository":{"url":"'$CI_PROJECT_URL'.git"}}' \ - "https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN" diff --git a/composer.json b/composer.json index 31445f9..3fc065b 100644 --- a/composer.json +++ b/composer.json @@ -31,5 +31,13 @@ }, "archive": { "exclude": [".?*"] + }, + "scripts": { + "test": [ + "vendor/bin/phpstan analyse -c loose.neon bin", + "vendor/bin/phpstan analyse -c strict.neon bin", + "vendor/bin/phpstan analyse -c symfony.neon -l 1 bin", + "vendor/bin/phpstan analyse -c phpunit.neon -l 1 bin" + ] } } diff --git a/loose.neon b/loose.neon index d5b4a0a..2bc6346 100644 --- a/loose.neon +++ b/loose.neon @@ -1,5 +1,5 @@ includes: - - ../../phpstan/phpstan-beberlei-assert/extension.neon + - %rootDir%/../phpstan-beberlei-assert/extension.neon parameters: level: 1 diff --git a/phpunit.neon b/phpunit.neon index ddde8bc..4824995 100644 --- a/phpunit.neon +++ b/phpunit.neon @@ -1,4 +1,4 @@ includes: - - ../../phpstan/phpstan-phpunit/extension.neon - - ../../phpstan/phpstan-phpunit/rules.neon - - ../../jangregor/phpstan-prophecy/src/extension.neon + - %rootDir%/../phpstan-phpunit/extension.neon + - %rootDir%/../phpstan-phpunit/rules.neon + - %rootDir%/../../jangregor/phpstan-prophecy/src/extension.neon diff --git a/symfony.neon b/symfony.neon index a886a7b..36b8175 100644 --- a/symfony.neon +++ b/symfony.neon @@ -1,10 +1,10 @@ includes: - - ../../phpstan/phpstan-doctrine/extension.neon - - ../../phpstan/phpstan-doctrine/rules.neon - - ../../phpstan/phpstan-symfony/extension.neon + - %rootDir%/../phpstan-doctrine/extension.neon + - %rootDir%/../phpstan-doctrine/rules.neon + - %rootDir%/../phpstan-symfony/extension.neon parameters: excludes_analyse: - - %rootDir%/../../../var - - %rootDir%/../../../app/cache - - %rootDir%/../../../app/logs + - %rootDir%/../../var + - %rootDir%/../../app/cache + - %rootDir%/../../app/logs -- GitLab