From b26c57237f7f0f7def838193402318eb49e39022 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Wed, 1 Jan 2020 19:55:33 +0100 Subject: [PATCH] Ensure BC of API, compat with `roave/you-are-using-it-wrong`, completeness of `composer.json` (#2140) * Test against `roave/you-are-using-it-wrong` * Added CI step to ensure BC of declared API * Added step to ensure `composer.json` has all used deps * Including CI check tools as dev dependencies * Typo fix: s/backwards/backward * Run `roave/backward-compatibility-check` off an isolated location with no other dependencies * Run `test-with-real-projects` task with PHP 7.4 as base runtime * Run `testing-with-real-projects` also against `ocramius/proxy-manager` `ocramius/proxy-manager` is an extremely heavy `vimeo/psalm` consumer, and relies on a lot of the templated types system to generate real types for proxies produced by runtime evaluation. --- .circleci/config.yml | 5 ++++- .travis.yml | 14 ++++++++++++++ bin/test-with-real-projects.sh | 15 +++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8ee16c30b..7fc050499 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,6 +4,9 @@ executors: php-72: docker: - image: thecodingmachine/php:7.2-v2-cli + php-74: + docker: + - image: thecodingmachine/php:7.4-v3-cli jobs: install-and-self-analyse: executor: php-72 @@ -90,7 +93,7 @@ jobs: paths: - build/psalm.phar test-with-real-projects: - executor: php-72 + executor: php-74 steps: - checkout # used here just for the side effect of loading the github public ssh key so we can clone other stuff - attach_workspace: diff --git a/.travis.yml b/.travis.yml index cc1e3252c..239ffea15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,6 +62,20 @@ jobs: script: - vendor/bin/phpcs + - stage: Ensure API BC + php: 7.4 + env: DEPS="high" + script: + - mkdir /tmp/bc-check && composer require --working-dir=/tmp/bc-check --dev roave/backward-compatibility-check:^4.0.0 + - /tmp/bc-check/vendor/bin/roave-backward-compatibility-check + + - stage: Ensure no transient used dependencies + php: 7.3 + env: DEPS="high" + script: + - composer require --dev maglnet/composer-require-checker:^2.0.0 + - ./vendor/bin/composer-require-checker check ./composer.json + - stage: Phar build php: 7.3 env: DEPS="high" diff --git a/bin/test-with-real-projects.sh b/bin/test-with-real-projects.sh index e95687f5f..d1e248d68 100755 --- a/bin/test-with-real-projects.sh +++ b/bin/test-with-real-projects.sh @@ -20,3 +20,18 @@ git clone git@github.com:muglug/collections.git cd collections composer install ~/project/psalm --monochrome --show-info=false + +cd /tmp/testing-with-real-projects + +git clone git@github.com:Ocramius/ProxyManager.git +cd ProxyManager +composer install +~/project/build/psalm.phar --monochrome + +cd /tmp/testing-with-real-projects + +git clone git@github.com:roave/you-are-using-it-wrong.git +cd you-are-using-it-wrong +composer install +~/project/build/psalm.phar --monochrome +./vendor/bin/phpunit