diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..2e93b31e7b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,196 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Build" + +on: + pull_request: + push: + branches: + - "master" + +env: + COMPOSER_ROOT_VERSION: "0.12.x-dev" + +jobs: + coding-standards: + name: "Coding Standard" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2.0.0" + + - name: "Install PHP" + uses: "shivammathur/setup-php@1.8.2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + + - name: "Validate Composer" + run: "composer validate" + + - name: "Cache dependencies" + uses: "actions/cache@v1.0.3" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-" + + - name: "Install dependencies" + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Composer Normalize" + run: "vendor/bin/phing composer-normalize-check" + + - name: "Lint" + run: "vendor/bin/phing lint" + + - name: "Coding Standard" + run: "vendor/bin/phing cs" + + dependency-analysis: + name: "Dependency Analysis" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2.0.0" + + - name: "Install PHP" + uses: "shivammathur/setup-php@1.8.2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + + - name: "Cache dependencies" + uses: "actions/cache@v1.0.3" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-" + + - name: "Install dependencies" + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Composer Require Checker" + run: "vendor/bin/phing composer-require-checker" + + tests: + name: "Tests" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.1" + - "7.2" + - "7.3" + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2.0.0" + + - name: "Install PHP" + uses: "shivammathur/setup-php@1.8.2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + + - name: "Cache dependencies" + uses: "actions/cache@v1.0.3" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-" + + - name: "Install dependencies" + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Tests" + run: "vendor/bin/phing tests" + + static-analysis: + name: "PHPStan" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.1" + - "7.2" + - "7.3" + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2.0.0" + + - name: "Install PHP" + uses: "shivammathur/setup-php@1.8.2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + + - name: "Cache dependencies" + uses: "actions/cache@v1.0.3" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-" + + - name: "Install dependencies" + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "PHPStan" + run: "vendor/bin/phing phpstan" + + static-analysis-with-static-php-parser: + name: "PHPStan with static PHP parser" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.1" + - "7.2" + - "7.3" + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2.0.0" + + - name: "Install PHP" + uses: "shivammathur/setup-php@1.8.2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + + - name: "Cache dependencies" + uses: "actions/cache@v1.0.3" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-" + + - name: "Install dependencies" + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "PHPStan with static PHP-Parser" + run: "vendor/bin/phing phpstan-static-php-parser" diff --git a/.travis.yml b/.travis.yml index 5ef796ca6f..6ed335d51d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,3 @@ -os: linux -dist: xenial language: php stages: @@ -7,13 +5,6 @@ stages: - name: phar if: (branch = master OR tag IS present) && type = push -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - - master - env: global: secure: "EpvZZ1v6JvefnfhgYm3Y2WprJxjgr6zDw2FJs+WISEtd1PHJToFJOE59vW7DRTcr5ycR4jrHyANqqIJWbH1k3A3wuyavmkissNKHbFK6vmLtAC9TuI/x5zBd+/T5yQ6i6uBe43nDzbkrQDYtGyNMdn1FXhWV9Z/hNCZ6uD0aiO5+d49NFJoexUOt3+LCxrZAGCCsm49KYRff/62QxO2Wajlfdhx+PLO0igY/i9N3oUQoVfbBEbP1ZSAPLv7ZkZGL4XdMMYEGYqnOeMWk39MYID34RmCYteWRfED4oqYbi4rzOpW8YeA/YkuHGThIykSLBrjdAfwUpekVEAI9r1gdrh91Gkpm/W/trFygdfI2gqev5GVjbYgmKQMm50l1W8wiD+Tb+AMUIttEXGjgwd+K2rn1RBHjM+CjPEWWdppg/7OOYVIJg0gIr94TN2LCQWDfFN5SxIIf0BpQmWteGEPCDpxCc3jsjpaVFXQ2jrui69Pdjr8/u7XCisQD9zpn4sQ43GZkdHC4rGOoBrjXQDWMB/LZyYNymJ6fkkuceqSgn6vDyBEkp9UBR1CIv4P8Ray86qEPodDFbPZMVX2JqDwUHMH3HVl4FINPYtVW3/VNUK7VihKd33+AjoX7anRTeq0T8jXUT4IF6tAxbO4DaDBB4XjQ3vCBDH15WxwIxy81KKA=" @@ -22,9 +13,6 @@ before_script: - if php --ri xdebug >/dev/null; then phpenv config-rm xdebug.ini; fi - composer update --no-interaction -script: - - vendor/bin/phing - jobs: allow_failures: - php: master @@ -33,6 +21,8 @@ jobs: - stage: test php: 7.3 name: Compiler tests + os: linux + dist: xenial script: - | cd compiler && \ @@ -41,13 +31,10 @@ jobs: ../bin/phpstan analyse -l 8 src tests && \ php bin/compile && \ ../tmp/phpstan.phar - - stage: test - php: 7.3 - name: PHPStan with static reflection for PHP-Parser - script: - - vendor/bin/phing phpstan-static-php-parser - stage: phar php: 7.3 + os: linux + dist: xenial before_install: - | openssl aes-256-cbc -K $encrypted_bd816b4f73f9_key -iv $encrypted_bd816b4f73f9_iv -in build/key.gpg.enc -out build/key.gpg -d && \ diff --git a/README.md b/README.md index 983167e265..b8d120f084 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # PHPStan - PHP Static Analysis Tool [![Build Status](https://travis-ci.org/phpstan/phpstan-src.svg)](https://travis-ci.org/phpstan/phpstan-src) +[![Build](https://github.com/phpstan/phpstan-src/workflows/Build/badge.svg)](https://github.com/phpstan/phpstan-src/actions) [![PHPStan Enabled](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan) --- diff --git a/build.xml b/build.xml index d96c551807..3f76255153 100644 --- a/build.xml +++ b/build.xml @@ -1,9 +1,9 @@ + value="tmp/composer-require-checker-2.1.0.phar"/> + value="https://github.com/maglnet/ComposerRequireChecker/releases/download/2.1.0/composer-require-checker.phar"/> @@ -280,6 +280,26 @@ + + + + + + + + + + - +