diff --git a/.cloveralls.yml b/.cloveralls.yml index 3b4fbe8f..99518e31 100644 --- a/.cloveralls.yml +++ b/.cloveralls.yml @@ -3,4 +3,4 @@ coverage_clover: build/logs/clover.xml # Same folder here json_path: build/logs/coveralls-upload.json # Don't touch that -service_name: travis-ci +# service_name: travis-ci diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml new file mode 100644 index 00000000..defe7163 --- /dev/null +++ b/.github/workflows/build_test.yml @@ -0,0 +1,61 @@ +name: Build + +on: + push: + pull_request: + +env: + COMPOSER_ARGS: '--no-progress' + +jobs: + build: + strategy: + matrix: + php_version: ['8.1', '8.2'] + deps: ['--prefer-lowest --prefer-dist', ''] + include: + - code-coverage: 'yes' + php_version: '8.2' + deps: '' + runs-on: ubuntu-latest + + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{matrix.php_version}} + + - name: Show PHP version + run: php -v + + - uses: actions/checkout@v4 + name: Checkout branch + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{matrix.php_version}}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php--${{matrix.php_version}}- + + - name: Install/update dependencies + run: composer update ${{matrix.deps}} $COMPOSER_ARGS + + - name: Run PHPUnit test suite + if: ${{ matrix.code-coverage != 'yes' }} + run: composer run-script test + + - name: Run PHPUnit test suite with coverage + if: ${{ matrix.code-coverage == 'yes' }} + run: composer run-script test-coverage + + - name: Upload coverage results to Coverall + if: ${{ matrix.code-coverage == 'yes' }} + uses: coverallsapp/github-action@v2 + + diff --git a/.travis.yml b/.travis.yml,deprecated similarity index 100% rename from .travis.yml rename to .travis.yml,deprecated diff --git a/README.md b/README.md index 8b8ab380..267e6ef8 100644 --- a/README.md +++ b/README.md @@ -3,27 +3,18 @@ [![Version](https://poser.pugx.org/lm-commons/lmc-rbac-mvc/version)](//packagist.org/packages/lm-commons/lmc-rbac-mvc) [![Total Downloads](https://poser.pugx.org/lm-commons/lmc-rbac-mvc/downloads)](//packagist.org/packages/lm-commons/lmc-rbac-mvc) [![License](https://poser.pugx.org/lm-commons/lmc-rbac-mvc/license)](//packagist.org/packages/lm-commons/lmc-rbac-mvc) -[![Master Branch Build Status](https://travis-ci.com/LM-Commons/LmcRbacMvc.svg?branch=master)](http://travis-ci.com/LM-Commons/LmcRbac) -[![Gitter](https://badges.gitter.im/LM-Commons/community.svg)](https://gitter.im/LM-Commons/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[![Build](https://github.com/lm-commons/LmcRbacMvc/actions/workflows/build_test.yml/badge.svg)](https://github.com/lm-commons/LmcRbacMvc/actions/workflows/build_test.yml) + [![Coverage Status](https://coveralls.io/repos/github/LM-Commons/LmcRbacMvc/badge.svg?branch=master)](https://coveralls.io/github/LM-Commons/LmcRbacMvc?branch=master) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/LM-Commons/LmcRbacMvc/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/LM-Commons/LmcRbacMvc/?branch=master) - -Role-based access control module to provide additional features on top of Zend\Permissions\Rbac - -Based on [ZF-Commons/zfc-rbac](https://github.com/ZF-Commons/zfc-rbac) v2.6.x. If you are looking for the Laminas version of zfc-rbac v3, please use [LM-Commons/LmcRbac](https://github.com/LM-Commons/LmcRbac). - -### Important Notes: - -This version has breaking changes with respect to ZfcRbac v2. See the [Upgrade](#upgrade) section for details. + +Role-based access control module to provide additional features on top of Laminas\Permissions\Rbac ## Requirements -- PHP 7.2 or higher -- [Zf-fr/Rbac component v1](https://github.com/zf-fr/rbac): this is actually a prototype for the ZF3 Rbac component. -- [Laminas Components 2.x | 3.x or higher](http://www.github.com/laminas) +- PHP 8.1 or higher +- [Laminas Components 3.x or higher](http://www.github.com/laminas) -> ## Optional @@ -33,7 +24,7 @@ the Laminas Developer toolbar. ## Upgrade -LmcRbac introduces breaking changes from zfcrbac v2: +LmcRbacMvc introduces breaking changes from zfcrbac v2: - The namespace has been changed from `ZfcRbac` to `LmcRbacMvc`. - The key `zfc_rbac` in autoload and module config files has been replaced by the `lmc_rbac` key. @@ -48,10 +39,8 @@ LmcRbacMvc only officially supports installation through Composer. For Composer Install the module: ```sh -$ php composer.phar require lm-commons/lmc-rbac-mvc:^3.0 +$ php composer.phar require lm-commons/lmc-rbac-mvc ``` -This will install a Laminas MVC equivalent of zfc-rbac 2.6.3. - Enable the module by adding `LmcRbacMvc` key to your `application.config.php` or `modules.config.php` file. Customize the module by copy-pasting the `lmc_rbac.global.php.dist` file to your `config/autoload` folder. @@ -65,4 +54,3 @@ of LmcRbac. ## Support - File issues at https://github.com/LM-Commons/LmcRbacMvc/issues. -- Ask questions in the [LM-Commons gitter](https://gitter.im/LM-Commons/community) chat. diff --git a/composer.json b/composer.json index 5ea0b202..a762d152 100644 --- a/composer.json +++ b/composer.json @@ -24,10 +24,14 @@ { "name": "Jean-Marie Leroux", "email": "jmleroux.pro@gmail.com" + }, + { + "name": "Eric Richer", + "email": "eric.richer@vistoconsulting.com" } ], "require": { - "php": "^7.4 || ^8.0", + "php": "^8.1.0 | ^8.2.0", "laminas/laminas-config": "^3.1", "laminas/laminas-eventmanager": "^3.0", "laminas/laminas-mvc": "^3.0", @@ -47,7 +51,8 @@ "squizlabs/php_codesniffer": "^3.5.5", "php-coveralls/php-coveralls": "^2.2", "phpspec/prophecy-phpunit": "^2.0", - "doctrine/doctrine-orm-module": "^4.1" + "doctrine/doctrine-orm-module": "^5.3", + "ext-mbstring": "*" }, "suggest": { "laminas/laminas-developer-tools": "if you want to show information about the roles",