From ab5d004399aab7a929ea3da074abf75ca62e733a Mon Sep 17 00:00:00 2001 From: Petr Parolek Date: Fri, 4 Jun 2021 22:58:08 +0200 Subject: [PATCH 1/2] allow build on all branches and scheduled builds --- .github/workflows/{tests.yml => main.yml} | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) rename .github/workflows/{tests.yml => main.yml} (91%) diff --git a/.github/workflows/tests.yml b/.github/workflows/main.yml similarity index 91% rename from .github/workflows/tests.yml rename to .github/workflows/main.yml index 17d4cba..29ebc38 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,14 @@ -name: Tests +name: "build" -on: [push, pull_request] +on: + pull_request: + paths-ignore: + - ".docs/**" + push: + branches: + - "*" + schedule: + - cron: "0 8 * * 1" # At 08:00 on Monday jobs: tests: From d89d4826b737c544638fba3131e319211e4ae4e9 Mon Sep 17 00:00:00 2001 From: Petr Parolek Date: Sat, 5 Jun 2021 13:58:02 +0200 Subject: [PATCH 2/2] CS fixes and added .editorconfig --- .editorconfig | 16 ++++++ .github/workflows/main.yml | 112 ++++++++++++++++++------------------- composer.json | 112 ++++++++++++++++++++----------------- 3 files changed, 133 insertions(+), 107 deletions(-) create mode 100644 .editorconfig 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 index 29ebc38..105e0c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,69 +1,69 @@ name: "build" on: - pull_request: - paths-ignore: - - ".docs/**" - push: - branches: - - "*" - schedule: - - cron: "0 8 * * 1" # At 08:00 on Monday + 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'] + tests: + runs-on: ubuntu-latest + strategy: + matrix: + php: [ '7.2', '7.3', '7.4' ] - fail-fast: false + 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 + 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 + - 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 + 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 + - 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 + 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 + - 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" + } + } }