From 71d9844a0fdc1da8b1e42b25173e27fda45c8a0d Mon Sep 17 00:00:00 2001 From: Denis Smetannikov Date: Wed, 28 Apr 2021 17:39:39 +0300 Subject: [PATCH] Update PHP deps (#3) --- .gitattributes | 5 +- .github/workflows/main.yml | 127 ++++++++++++++++++++++++++++++++++ .phan/config.php => .phan.php | 7 +- .travis.yml | 10 +-- Makefile | 2 +- composer.json | 33 ++++----- 6 files changed, 156 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/main.yml rename .phan/config.php => .phan.php (68%) diff --git a/.gitattributes b/.gitattributes index 63c0ce0..6741dfb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,13 +11,16 @@ # @link https://github.com/JBZoo/Less # -/.phan export-ignore + +/.github export-ignore /build export-ignore +/cache 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 new file mode 100644 index 0000000..ea722c6 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,127 @@ +# +# JBZoo Toolbox - Less +# +# This file is part of the JBZoo Toolbox project. +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @package Less +# @license MIT +# @copyright Copyright (C) JBZoo.com, All rights reserved. +# @link https://github.com/JBZoo/Less +# + +name: CI + +on: + pull_request: + branches: + - "*" + push: + branches: + - 'master' + schedule: + - cron: '30 */8 * * *' + +env: + COLUMNS: 120 + TERM_PROGRAM: Hyper + +jobs: + phpunit: + name: PHPUnit + runs-on: ubuntu-latest + env: + JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }} + strategy: + matrix: + php-version: [ 7.2, 7.3, 7.4, 8.0 ] + composer_flags: [ "--prefer-lowest", "" ] + 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: ๐Ÿงช PHPUnit Tests + 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 + run: make codestyle --no-print-directory + + - 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 68% rename from .phan/config.php rename to .phan.php index 7bf5b18..8616aca 100644 --- a/.phan/config.php +++ b/.phan.php @@ -15,7 +15,12 @@ declare(strict_types=1); -$default = include __DIR__ . '/../vendor/jbzoo/codestyle/src/phan/default.php'; +if (version_compare(PHP_VERSION, '8.0') >= 0 && getenv('CI_TRAVIS')) { + echo "Doesn't compatible with PHP 8.0 in travis. Needs PHP ext-ast. See GitHub Actions =( instead"; + die(0); +} + +$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan/default.php'; return array_merge($default, [ 'directory_list' => [ diff --git a/.travis.yml b/.travis.yml index 90cfec8..19392f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,18 +15,14 @@ language: php os: linux dist: xenial +git: + depth: false + php: - 7.2 - 7.3 - 7.4 - 8.0 - - nightly - -jobs: - fast_finish: true - allow_failures: - - php: 8.0 - - php: nightly env: matrix: diff --git a/Makefile b/Makefile index f3ef4c6..6b66a7a 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ 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 diff --git a/composer.json b/composer.json index 2012238..9085ab8 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,13 @@ { - "name" : "jbzoo/less", - "type" : "library", - "description" : "PHP wrapper for any less-compilers", - "license" : "MIT", - "keywords" : [ + "name" : "jbzoo/less", + "type" : "library", + "description" : "PHP wrapper for any less-compilers", + "license" : "MIT", + "keywords" : [ "less", "css", "less.js", "stylesheet", "jbzoo", "packagist", "lessc", "gpeasy", "leafo", "lesscss", "compiler" ], - "authors" : [ + "authors" : [ { "name" : "Denis Smetannikov", "email" : "admin@jbzoo.com", @@ -15,36 +15,33 @@ } ], - "require" : { + "require" : { "php" : ">=7.2", - "jbzoo/data" : "^4.2.0", - "jbzoo/utils" : "^4.3.0", + "jbzoo/data" : "^4.3.0", + "jbzoo/utils" : "^4.5.0", "wikimedia/less.php" : "^3.1.0" }, - "require-dev" : { - "jbzoo/toolbox-dev" : "^2.10.0" + "require-dev" : { + "jbzoo/toolbox-dev" : "^2.13.1" }, - "autoload" : { + "autoload" : { "psr-4" : { "JBZoo\\Less\\" : "src" } }, - "minimum-stability" : "dev", - "prefer-stable" : true, - - "autoload-dev" : { + "autoload-dev" : { "classmap" : ["tests"] }, - "config" : { + "config" : { "optimize-autoloader" : true }, - "extra" : { + "extra" : { "branch-alias" : { "dev-master" : "4.x-dev" }