From a8922945ef192b323167728e395af2233ac98c5b Mon Sep 17 00:00:00 2001 From: Denis Smetannikov Date: Wed, 28 Apr 2021 17:56:25 +0300 Subject: [PATCH] Update PHP deps (#5) --- .gitattributes | 2 +- .github/workflows/main.yml | 89 ++++++++++++++++++++++++++++------- .phan/config.php => .phan.php | 2 +- .travis.yml | 8 ---- Makefile | 3 +- composer.json | 6 +-- src/Path.php | 2 +- 7 files changed, 79 insertions(+), 33 deletions(-) rename .phan/config.php => .phan.php (88%) diff --git a/.gitattributes b/.gitattributes index 27807c0..b0217e8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,13 +11,13 @@ # @link https://github.com/JBZoo/Path # -/.phan export-ignore /build export-ignore /tests export-ignore /.editorconfig export-ignore /.gitattributes export-ignore /.gitignore export-ignore /.travis.yml export-ignore +/.phan.php export-ignore /phpunit.xml.dist export-ignore /Makefile export-ignore diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8efd05a..2e2d091 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ # @link https://github.com/JBZoo/Path # -name: Continuous Integration +name: CI on: pull_request: @@ -21,7 +21,7 @@ on: branches: - 'master' schedule: - - cron: '15 */8 * * *' + - cron: '30 */8 * * *' env: COLUMNS: 120 @@ -35,38 +35,93 @@ jobs: JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }} strategy: matrix: - php-version: [ 7.2, 7.3, 7.4 ] - coverage: [ xdebug, none ] - experimental: [ false ] + php-version: [ 7.2, 7.3, 7.4, 8.0 ] composer_flags: [ "--prefer-lowest", "" ] - include: - - php-version: "8.0" - experimental: true - - php-version: "8.1" - experimental: true steps: - name: Checkout code uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: Setup PHP and composer + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - coverage: ${{ matrix.coverage }} + coverage: xdebug tools: composer - name: Build the Project - continue-on-error: ${{ matrix.experimental }} run: make update --no-print-directory - name: ๐Ÿงช PHPUnit Tests - continue-on-error: ${{ matrix.experimental }} run: make test --no-print-directory + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }} + path: build/ + + + linters: + name: Linters + runs-on: ubuntu-latest + strategy: + matrix: + php-version: [ 7.2, 7.3, 7.4, 8.0 ] + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: ast + tools: composer + + - name: Build the Project + run: make update --no-print-directory + - name: ๐Ÿ‘ Code Quality - continue-on-error: ${{ matrix.experimental }} run: make codestyle --no-print-directory - - name: ๐Ÿ“ Build All Reports at Once - continue-on-error: ${{ matrix.experimental }} + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: Linters - ${{ matrix.php-version }} + path: build/ + + + report: + name: Reports + runs-on: ubuntu-latest + strategy: + matrix: + php-version: [ 7.2, 7.3, 7.4, 8.0 ] + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: xdebug + tools: composer + + - name: Build the Project + run: make update --no-print-directory + + - name: ๐Ÿ“ Build Reports run: make report-all --no-print-directory + + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: Reports - ${{ matrix.php-version }} + path: build/ diff --git a/.phan/config.php b/.phan.php similarity index 88% rename from .phan/config.php rename to .phan.php index 1f878a5..48b8612 100644 --- a/.phan/config.php +++ b/.phan.php @@ -15,7 +15,7 @@ declare(strict_types=1); -$default = include __DIR__ . '/../vendor/jbzoo/codestyle/src/phan/default.php'; +$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan/default.php'; $config = array_merge($default, [ 'directory_list' => [ diff --git a/.travis.yml b/.travis.yml index 474a0ee..9493756 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,19 +20,11 @@ php: - 7.3 - 7.4 - 8.0 - - nightly - -jobs: - fast_finish: true - allow_failures: - - php: 8.0 - - php: nightly env: matrix: - JBZOO_COMPOSER_UPDATE_FLAGS="--prefer-lowest --prefer-stable" - JBZOO_COMPOSER_UPDATE_FLAGS="" - - XDEBUG_OFF="yes" before_script: - composer self-update diff --git a/Makefile b/Makefile index 8a47e28..a3e8067 100644 --- a/Makefile +++ b/Makefile @@ -19,10 +19,9 @@ endif update: ##@Project Install/Update all 3rd party dependencies $(call title,"Install/Update all 3rd party dependencies") @echo "Composer flags: $(JBZOO_COMPOSER_UPDATE_FLAGS)" - @composer update $(JBZOO_COMPOSER_UPDATE_FLAGS) + @composer update --no-progress $(JBZOO_COMPOSER_UPDATE_FLAGS) test-all: ##@Project Run all project tests at once @make test - @make test-performance-travis @make codestyle diff --git a/composer.json b/composer.json index aa376a8..884ea12 100644 --- a/composer.json +++ b/composer.json @@ -19,12 +19,12 @@ "require" : { "php" : ">=7.2", - "jbzoo/utils" : "^4.4.0", - "jbzoo/data" : "^4.2.1" + "jbzoo/utils" : "^4.5.0", + "jbzoo/data" : "^4.3.0" }, "require-dev" : { - "jbzoo/toolbox-dev" : "^2.12.0" + "jbzoo/toolbox-dev" : "^2.13.1" }, "autoload" : { diff --git a/src/Path.php b/src/Path.php index c429b1e..12efc09 100644 --- a/src/Path.php +++ b/src/Path.php @@ -29,7 +29,7 @@ * @package JBZoo\Path * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ -class Path +final class Path { // Minimal alias name length. public const MIN_ALIAS_LENGTH = 2;