diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..3faf149 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig is awesome: http://EditorConfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab +indent_size = tab +tab_width = 4 + +[{*.json, *.yaml, *.yml, *.md}] +indent_style = space +indent_size = 2 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..105e0c3 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,69 @@ +name: "build" + +on: + pull_request: + paths-ignore: + - ".docs/**" + push: + branches: + - "*" + schedule: + - cron: "0 8 * * 1" # At 08:00 on Monday + +jobs: + tests: + runs-on: ubuntu-latest + strategy: + matrix: + php: [ '7.2', '7.3', '7.4' ] + + fail-fast: false + + name: PHP ${{ matrix.php }} tests + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: json, mbstring, xml, tokenizer + coverage: none + + - run: composer install --no-interaction --prefer-source + - run: vendor/bin/tester tests -s -C + - if: failure() + uses: actions/upload-artifact@v1 + with: + name: output + path: tests/PdfResponse/output + + lowest_dependencies: + name: Lowest Dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: 7.2 + extensions: json, mbstring, xml, tokenizer + coverage: none + + - run: composer update --no-interaction --prefer-dist --prefer-lowest --prefer-stable + - run: vendor/bin/tester tests -s -C + + + code_coverage: + name: Code Coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + extensions: json, mbstring, xml, tokenizer, xdebug + coverage: none + + - run: mkdir -p tests/tmp + - run: composer install --no-progress --prefer-dist + - run: wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar + - run: vendor/bin/tester -p phpdbg tests -s -C --coverage ./coverage.xml --coverage-src ./src + - run: php coveralls.phar --verbose --config tests/.coveralls.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 17d4cba..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Tests - -on: [push, pull_request] - -jobs: - tests: - runs-on: ubuntu-latest - strategy: - matrix: - php: ['7.2', '7.3', '7.4'] - - fail-fast: false - - name: PHP ${{ matrix.php }} tests - steps: - - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: json, mbstring, xml, tokenizer - coverage: none - - - run: composer install --no-interaction --prefer-source - - run: vendor/bin/tester tests -s -C - - if: failure() - uses: actions/upload-artifact@v1 - with: - name: output - path: tests/PdfResponse/output - - lowest_dependencies: - name: Lowest Dependencies - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@v2 - with: - php-version: 7.2 - extensions: json, mbstring, xml, tokenizer - coverage: none - - - run: composer update --no-interaction --prefer-dist --prefer-lowest --prefer-stable - - run: vendor/bin/tester tests -s -C - - - code_coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@v2 - with: - php-version: 7.4 - extensions: json, mbstring, xml, tokenizer, xdebug - coverage: none - - - run: mkdir -p tests/tmp - - run: composer install --no-progress --prefer-dist - - run: wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar - - run: vendor/bin/tester -p phpdbg tests -s -C --coverage ./coverage.xml --coverage-src ./src - - run: php coveralls.phar --verbose --config tests/.coveralls.yml diff --git a/composer.json b/composer.json index e04597b..98b04f5 100644 --- a/composer.json +++ b/composer.json @@ -1,53 +1,63 @@ { - "name": "ublaboo/datagrid-nette-database-data-source", - "type": "library", - "description": "Utility that makes possible to use Nette\\Database native query with Ublaboo\\DataGrid", - "keywords": ["datagrid", "grid", "nette", "ublaboo", "database", "data", "source"], - "homepage": "https://ublaboo.org/datagrid-nette-database-data-source", - "license": ["MIT"], - "support": { - "issues": "https://github.com/ublaboo/datagrid-nette-database-data-source/issues" - }, - "authors": [ - { - "name": "Pavel Janda", - "homepage": "http://paveljanda.com" - } - ], - "autoload": { - "psr-4": { - "Ublaboo\\NetteDatabaseDataSource\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Ublaboo\\NetteDatabaseDataSource\\Tests\\": "tests" - } - }, - "require": { - "php": "^7.2", - "nette/database" : "^3.0", - "ublaboo/datagrid" : "^6.0", - "greenlion/php-sql-parser" : "^4.2" - }, - "require-dev": { - "nette/tester": "^2.2", - "tracy/tracy": "^2.6", - "mockery/mockery" : "^1.2", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "ninjify/coding-standard": "^0.9" - }, - "prefer-stable": true, - "minimum-stability": "dev", - "scripts": { - "phpstan": "vendor/phpstan/phpstan/bin/phpstan analyse -c vendor/phpstan/phpstan-strict-rules/rules.neon src --level 7", - "phpcs": "vendor/bin/phpcs --standard=vendor/ninjify/coding-standard/ruleset-gamee.xml --extensions=php,phpt --tab-width=4 --ignore=temp -sp src tests", - "phpcsfix": "vendor/bin/phpcbf --standard=vendor/ninjify/coding-standard/ruleset-gamee.xml --extensions=php,phpt --tab-width=4 --ignore=temp -sp src tests" - }, - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - } + "name": "ublaboo/datagrid-nette-database-data-source", + "type": "library", + "description": "Utility that makes possible to use Nette\\Database native query with Ublaboo\\DataGrid", + "keywords": [ + "datagrid", + "grid", + "nette", + "ublaboo", + "database", + "data", + "source" + ], + "homepage": "https://ublaboo.org/datagrid-nette-database-data-source", + "license": [ + "MIT" + ], + "support": { + "issues": "https://github.com/ublaboo/datagrid-nette-database-data-source/issues" + }, + "authors": [ + { + "name": "Pavel Janda", + "homepage": "http://paveljanda.com" + } + ], + "autoload": { + "psr-4": { + "Ublaboo\\NetteDatabaseDataSource\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Ublaboo\\NetteDatabaseDataSource\\Tests\\": "tests" + } + }, + "require": { + "php": "^7.2", + "nette/database": "^3.0", + "ublaboo/datagrid": "^6.0", + "greenlion/php-sql-parser": "^4.2" + }, + "require-dev": { + "nette/tester": "^2.2", + "tracy/tracy": "^2.6", + "mockery/mockery": "^1.2", + "phpstan/phpstan": "^0.11", + "phpstan/phpstan-strict-rules": "^0.11", + "ninjify/coding-standard": "^0.9" + }, + "prefer-stable": true, + "minimum-stability": "dev", + "scripts": { + "phpstan": "vendor/phpstan/phpstan/bin/phpstan analyse -c vendor/phpstan/phpstan-strict-rules/rules.neon src --level 7", + "phpcs": "vendor/bin/phpcs --standard=vendor/ninjify/coding-standard/ruleset-gamee.xml --extensions=php,phpt --tab-width=4 --ignore=temp -sp src tests", + "phpcsfix": "vendor/bin/phpcbf --standard=vendor/ninjify/coding-standard/ruleset-gamee.xml --extensions=php,phpt --tab-width=4 --ignore=temp -sp src tests" + }, + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + } }