Browse Source

DX: use PHIVE for dev tools

Dariusz Ruminski 5 years ago
parent
commit
9425c9c8d8
6 changed files with 30 additions and 8 deletions
  1. 3 5
      .travis.yml
  2. 2 2
      composer.json
  3. 1 0
      dev-tools/.gitignore
  4. 0 1
      dev-tools/composer.json
  5. 19 0
      dev-tools/install.sh
  6. 5 0
      dev-tools/phive.xml

+ 3 - 5
.travis.yml

@@ -6,6 +6,7 @@ git:
 cache:
     directories:
         - $HOME/.composer
+        - $HOME/.phive
         - $HOME/bin
 
 env:
@@ -28,13 +29,10 @@ jobs:
             php: 7.2
             env: COMPOSER_FLAGS="--no-dev --prefer-stable"
             install:
-                - travis_retry composer update -d dev-tools $DEFAULT_COMPOSER_FLAGS
-                - composer info -d dev-tools -D | sort
+                - ./dev-tools/install.sh
 
                 - travis_retry composer update $DEFAULT_COMPOSER_FLAGS $COMPOSER_FLAGS
                 - composer info -D | sort
-
-                - ./dev-tools/bin-download.sh
             before_script:
                 - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then COMMIT_RANGE=$TRAVIS_COMMIT_RANGE; else COMMIT_RANGE="HEAD~..HEAD"; fi;
                 - export COMMIT_SCA_FILES=`git diff --name-only --diff-filter=ACMRTUXB $COMMIT_RANGE`
@@ -54,7 +52,7 @@ jobs:
                     && (echo "UNKNOWN FILES DETECTED" && travis_terminate 1) || echo "NO UNKNOWN FILES"
                 - ./check_trailing_spaces.sh || travis_terminate 1
                 - if [ -n "$COMMIT_SCA_FILES" ]; then ./dev-tools/vendor/bin/phpmd `echo "$COMMIT_SCA_FILES" | grep -Ev "^tests/Fixtures" | xargs | sed 's/ /,/g'` text phpmd.xml || travis_terminate 1; fi
-                - ./dev-tools/vendor/bin/composer-require-checker check composer.json --config-file=.composer-require-checker.json || travis_terminate 1
+                - ./dev-tools/tools/composer-require-checker check composer.json --config-file $(realpath .composer-require-checker.json) || travis_terminate 1
                 - composer normalize -d ./dev-tools ./../composer.json --dry-run
                 - ./dev-tools/check-shell-scripts.sh
 

+ 2 - 2
composer.json

@@ -41,8 +41,8 @@
         "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.1",
         "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1",
         "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.1",
-        "phpunitgoodpractices/traits": "^1.5.1",
-        "symfony/phpunit-bridge": "^4.0",
+        "phpunitgoodpractices/traits": "^1.8",
+        "symfony/phpunit-bridge": "^4.3",
         "symfony/yaml": "^3.0 || ^4.0"
     },
     "suggest": {

+ 1 - 0
dev-tools/.gitignore

@@ -1,3 +1,4 @@
 /composer.lock
 /bin/
+/tools/
 /vendor/

+ 0 - 1
dev-tools/composer.json

@@ -5,7 +5,6 @@
     "require-dev": {
         "humbug/box": "~3.7.0",
         "localheinz/composer-normalize": "^1.1",
-        "maglnet/composer-require-checker": "^2.0",
         "mi-schi/phpmd-extension": "^4.3",
         "phpmd/phpmd": "^2.6"
     },

+ 19 - 0
dev-tools/bin-download.sh → dev-tools/install.sh

@@ -9,15 +9,34 @@ mkdir -p bin
 VERSION_CB="2.0.0.2"
 VERSION_SC="stable"
 
+echo λλλ phive
+if [ ! -f bin/phive ]; then
+    wget --no-clobber --output-document=bin/phive https://phar.io/releases/phive.phar
+    wget --no-clobber --output-document=bin/phive.asc https://phar.io/releases/phive.phar.asc
+    gpg --keyserver pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79
+    gpg --verify bin/phive.asc bin/phive
+    chmod u+x bin/phive
+    bin/phive --version
+fi
+
+echo λλλ checkbashisms
 if [ ! -f bin/checkbashisms ]; then
     wget --no-clobber --output-document=bin/checkbashisms https://sourceforge.net/projects/checkbaskisms/files/${VERSION_CB}/checkbashisms/download
     chmod u+x bin/checkbashisms
     bin/checkbashisms --version
 fi
 
+echo λλλ shellcheck
 if [ ! -f bin/shellcheck ]; then
     wget -qO- "https://storage.googleapis.com/shellcheck/shellcheck-${VERSION_SC}.linux.x86_64.tar.xz" | tar -xJv --directory bin shellcheck-${VERSION_SC}/shellcheck
     mv "bin/shellcheck-${VERSION_SC}/shellcheck" bin/
     rmdir "bin/shellcheck-${VERSION_SC}/"
     bin/shellcheck --version
 fi
+
+echo λλλ composer packages
+composer update
+composer info -D | sort
+
+echo λλλ phive packages
+./bin/phive install --trust-gpg-keys D2CCAC42F6295E7D,8E730BA25823D8B5

+ 5 - 0
dev-tools/phive.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phive xmlns="https://phar.io/phive">
+  <phar name="composer-require-checker" version="^2.0" installed="2.0.0" location="./tools/composer-require-checker" copy="false"/>
+  <phar name="phpstan" version="^0.11.15" installed="0.11.15" location="./tools/phpstan" copy="false"/>
+</phive>