diff --git a/.editorconfig b/.editorconfig index 575834a..a828607 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,6 +11,6 @@ indent_style = tab indent_size = tab tab_width = 4 -[{*.json,*.yml,*.md}] +[{*.json,*.yml,*.yaml,*.md}] indent_style = space indent_size = 2 diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..a095035 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,270 @@ +name: "build" + +on: + pull_request: + paths-ignore: + - ".docs/**" + push: + branches: + - "master" + schedule: + - cron: "0 8 * * 1" # At 08:00 on Monday + +env: + extensions: "json" + cache-version: "1" + composer-version: "v1" + composer-install: "composer update --no-interaction --no-progress --no-suggest --prefer-dist --prefer-stable" + +jobs: + qa: + name: "Quality assurance" + runs-on: "${{ matrix.operating-system }}" + + strategy: + matrix: + php-version: ["7.4"] + operating-system: ["ubuntu-latest"] + fail-fast: false + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Setup PHP cache environment" + id: "extcache" + uses: "shivammathur/cache-extensions@v1" + with: + php-version: "${{ matrix.php-version }}" + extensions: "${{ env.extensions }}" + key: "${{ env.cache-version }}" + + - name: "Cache PHP extensions" + uses: "actions/cache@v2" + with: + path: "${{ steps.extcache.outputs.dir }}" + key: "${{ steps.extcache.outputs.key }}" + restore-keys: "${{ steps.extcache.outputs.key }}" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + extensions: "${{ env.extensions }}" + tools: "composer:${{ env.composer-version }} " + + - name: "Setup problem matchers for PHP" + run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' + + - name: "Get Composer cache directory" + id: "composercache" + run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"' + + - name: "Cache PHP dependencies" + uses: "actions/cache@v2" + with: + path: "${{ steps.composercache.outputs.dir }}" + key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "${{ runner.os }}-composer-" + + - name: "Validate Composer" + run: "composer validate" + + - name: "Install dependencies" + run: "${{ env.composer-install }}" + + - name: "Coding Standard" + run: "make cs" + + static-analysis: + name: "Static analysis" + runs-on: "${{ matrix.operating-system }}" + + strategy: + matrix: + php-version: ["7.4"] + operating-system: ["ubuntu-latest"] + fail-fast: false + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Setup PHP cache environment" + id: "extcache" + uses: "shivammathur/cache-extensions@v1" + with: + php-version: "${{ matrix.php-version }}" + extensions: "${{ env.extensions }}" + key: "${{ env.cache-version }}" + + - name: "Cache PHP extensions" + uses: "actions/cache@v2" + with: + path: "${{ steps.extcache.outputs.dir }}" + key: "${{ steps.extcache.outputs.key }}" + restore-keys: "${{ steps.extcache.outputs.key }}" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + extensions: "${{ env.extensions }}" + tools: "composer:${{ env.composer-version }} " + + - name: "Setup problem matchers for PHP" + run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' + + - name: "Get Composer cache directory" + id: "composercache" + run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"' + + - name: "Cache PHP dependencies" + uses: "actions/cache@v2" + with: + path: "${{ steps.composercache.outputs.dir }}" + key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "${{ runner.os }}-composer-" + + - name: "Install dependencies" + run: "${{ env.composer-install }}" + + - name: "PHPStan" + run: "make phpstan" + + tests: + name: "Tests" + runs-on: "${{ matrix.operating-system }}" + + strategy: + matrix: + php-version: ["7.2", "7.3", "7.4"] + operating-system: ["ubuntu-latest"] + composer-args: [ "" ] + include: + - php-version: "7.2" + operating-system: "ubuntu-latest" + composer-args: "--prefer-lowest" + - php-version: "8.0" + operating-system: "ubuntu-latest" + composer-args: "--ignore-platform-reqs" + fail-fast: false + + continue-on-error: "${{ matrix.php-version == '8.0' }}" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Setup PHP cache environment" + id: "extcache" + uses: "shivammathur/cache-extensions@v1" + with: + php-version: "${{ matrix.php-version }}" + extensions: "${{ env.extensions }}" + key: "${{ env.cache-version }}" + + - name: "Cache PHP extensions" + uses: "actions/cache@v2" + with: + path: "${{ steps.extcache.outputs.dir }}" + key: "${{ steps.extcache.outputs.key }}" + restore-keys: "${{ steps.extcache.outputs.key }}" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + extensions: "${{ env.extensions }}" + tools: "composer:${{ env.composer-version }} " + + - name: "Setup problem matchers for PHP" + run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' + + - name: "Get Composer cache directory" + id: "composercache" + run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"' + + - name: "Cache PHP dependencies" + uses: "actions/cache@v2" + with: + path: "${{ steps.composercache.outputs.dir }}" + key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "${{ runner.os }}-composer-" + + - name: "Install dependencies" + run: "${{ env.composer-install }} ${{ matrix.composer-args }}" + + - name: "Setup problem matchers for PHPUnit" + run: 'echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"' + + - name: "Tests" + run: "make tests" + + tests-code-coverage: + name: "Tests with code coverage" + runs-on: "${{ matrix.operating-system }}" + + strategy: + matrix: + php-version: ["7.4"] + operating-system: ["ubuntu-latest"] + fail-fast: false + + if: "github.event_name == 'push'" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Setup PHP cache environment" + id: "extcache" + uses: "shivammathur/cache-extensions@v1" + with: + php-version: "${{ matrix.php-version }}" + extensions: "${{ env.extensions }}" + key: "${{ env.cache-version }}" + + - name: "Cache PHP extensions" + uses: "actions/cache@v2" + with: + path: "${{ steps.extcache.outputs.dir }}" + key: "${{ steps.extcache.outputs.key }}" + restore-keys: "${{ steps.extcache.outputs.key }}" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + extensions: "${{ env.extensions }}" + tools: "composer:${{ env.composer-version }} " + + - name: "Setup problem matchers for PHP" + run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' + + - name: "Get Composer cache directory" + id: "composercache" + run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"' + + - name: "Cache PHP dependencies" + uses: "actions/cache@v2" + with: + path: "${{ steps.composercache.outputs.dir }}" + key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "${{ runner.os }}-composer-" + + - name: "Install dependencies" + run: "${{ env.composer-install }}" + + - name: "Tests" + run: "make coverage" + + - name: "Coveralls.io" + env: + CI_NAME: github + CI: true + COVERALLS_REPO_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + run: | + wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar + php php-coveralls.phar --verbose --config tests/.coveralls.yml + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2ca55a0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,56 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - - 7.4snapshot - - nightly - -before_install: - - phpenv config-rm xdebug.ini || return 0 # Turn off XDebug - -install: - - travis_retry composer install --no-progress --prefer-dist - -script: - - make tests - -jobs: - include: - - env: title="Lowest Dependencies" - php: 7.2 - install: - - travis_retry composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable - script: - - make tests - - - stage: Quality Assurance - php: 7.3 - script: - - make qa - - - stage: Test Coverage - if: branch = master AND type = push - php: 7.3 - script: - - make coverage - after_script: - - composer global require php-coveralls/php-coveralls ^2.1.0 - - ~/.composer/vendor/bin/php-coveralls --verbose --config tests/.coveralls.yml - - - stage: Outdated Dependencies - if: branch = master AND type = cron - php: 7.3 - script: - - composer outdated --direct - - allow_failures: - - stage: Test Coverage - - php: 7.4snapshot - - php: nightly - -sudo: false - -cache: - directories: - - $HOME/.composer/cache diff --git a/Makefile b/Makefile index 3b10a16..307d7e9 100644 --- a/Makefile +++ b/Makefile @@ -26,4 +26,4 @@ tests: ## Run all tests vendor/bin/phpunit tests --cache-result-file=tests/tmp/phpunit.cache --colors=always coverage: ## Generate code coverage in XML format - phpdbg -qrr vendor/bin/phpunit tests --cache-result-file=tests/tmp/phpunit.cache --colors=always -c tests/coverage.xml + vendor/bin/phpunit tests --cache-result-file=tests/tmp/phpunit.cache --colors=always -c tests/coverage.xml diff --git a/README.md b/README.md index 35e31f9..04c80b1 100755 --- a/README.md +++ b/README.md @@ -1,56 +1,75 @@ -# Nettrine Annotations +![Nettrine Annotations](https://heatbadger.now.sh/github/readme/nettrine/annotations/) -[Doctrine/Annotations](https://www.doctrine-project.org/projects/annotations.html) for Nette Framework. +

+ + + + + + + + + + + + +

+

+ + + + + + + + + + + + + + + +

-[![Build Status](https://img.shields.io/travis/nettrine/annotations.svg?style=flat-square)](https://travis-ci.org/nettrine/annotations) -[![Code coverage](https://img.shields.io/coveralls/nettrine/annotations.svg?style=flat-square)](https://coveralls.io/r/nettrine/annotations) -[![Licence](https://img.shields.io/packagist/l/nettrine/annotations.svg?style=flat-square)](https://packagist.org/packages/nettrine/annotations) -[![Downloads this Month](https://img.shields.io/packagist/dm/nettrine/annotations.svg?style=flat-square)](https://packagist.org/packages/nettrine/annotations) -[![Downloads total](https://img.shields.io/packagist/dt/nettrine/annotations.svg?style=flat-square)](https://packagist.org/packages/nettrine/annotations) -[![Latest stable](https://img.shields.io/packagist/v/nettrine/annotations.svg?style=flat-square)](https://packagist.org/packages/nettrine/annotations) -[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat-square)](https://github.com/phpstan/phpstan) +

+Website 🚀 contributte.org | Contact 👨🏻💻 f3l1x.io | Twitter 🐦 @contributte +

-## Discussion / Help +## Usage -[![Join the chat](https://img.shields.io/gitter/room/nettrine/nettrine.svg?style=flat-square)](https://gitter.im/nettrine/nettrine) +To install the latest version of `nettrine/annotations` use [Composer](https://getcomposer.com). + +``` +composer require nettrine/annotations +``` ## Documentation -- [Setup](.docs/README.md#setup) -- [Relying](.docs/README.md#relying) -- [Configuration](.docs/README.md#configuration) -- [Usage](.docs/README.md#usage) -- [Examples](.docs/README.md#examples) +For details on how to use this package, check out our [documentation](.docs). ## Versions -| State | Version | Branch | Nette | PHP | -|--------|---------|----------|--------|--------| -| dev | `^0.7` | `master` | `3.0+` | `^7.2` | -| stable | `^0.6` | `master` | `3.0+` | `^7.2` | -| stable | `^0.4` | `master` | `2.4` | `^7.1` | - -## Maintainers - - - - - - - - -
- - - -
- Milan Felix Šulc -
- - - -
- Marek Bartoš -
- -Thank you for testing, reporting and contributing. +| State | Version | Branch | Nette | PHP | +|--------|---------|----------|--------|---------| +| dev | `^0.7` | `master` | `3.0+` | `>=7.2` | +| stable | `^0.6` | `master` | `3.0+` | `^7.2` | +| stable | `^0.4` | `master` | `2.4` | `^7.1` | + +## Development + +See [how to contribute](https://contributte.org/contributing.html) to this package. + +This package is currently maintaining by these authors. + + + + + +## Sponsoring + + + + + +The development is sponsored by [Tlapnet](https://www.tlapnet.cz) diff --git a/tests/.coveralls.yml b/tests/.coveralls.yml index 82764a3..8450382 100644 --- a/tests/.coveralls.yml +++ b/tests/.coveralls.yml @@ -1,4 +1,4 @@ # for php-coveralls -service_name: travis-ci +service_name: github-actions coverage_clover: coverage.xml json_path: coverage.json