From c8a5d28a98762419fca46c001ce566d4536e86d5 Mon Sep 17 00:00:00 2001 From: Samuel Kelemen Date: Tue, 2 Nov 2021 08:44:15 +0100 Subject: [PATCH 1/4] Add github actions --- .github/workflows/php.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..9337f16 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,33 @@ +name: Composer outdated + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: [ '7.1', '7.2', '7.3', '7.4' ] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + + - name: Validate composer.json + run: composer validate --strict + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-interaction + + - name: Composer outdated + run: composer outdated -D --strict From 51ab5131f6f7ceaff4af1441b1f00b055fb505d5 Mon Sep 17 00:00:00 2001 From: Samuel kelemen Date: Tue, 2 Nov 2021 08:51:03 +0100 Subject: [PATCH 2/4] Tests --- .github/workflows/{php.yml => composer.yml} | 0 .github/workflows/phpstan.yml | 36 +++++++++++++++++++++ 2 files changed, 36 insertions(+) rename .github/workflows/{php.yml => composer.yml} (100%) create mode 100644 .github/workflows/phpstan.yml diff --git a/.github/workflows/php.yml b/.github/workflows/composer.yml similarity index 100% rename from .github/workflows/php.yml rename to .github/workflows/composer.yml diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000..0e5f2a7 --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,36 @@ +name: PHPstan + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: [ '7.1', '7.2', '7.3', '7.4' ] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + + - name: Validate composer.json + run: composer validate --strict + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-interaction + + - name: Install PHPStan + run: composer require phpstan/phpstan --dev + + - name: PHPStan analyse + run: vendor/bin/phpstan analyze src --level=max --no-progress From d7a60fb9e6e3f0e75136dbc36e17731856090ed4 Mon Sep 17 00:00:00 2001 From: Samuel kelemen Date: Tue, 2 Nov 2021 09:05:35 +0100 Subject: [PATCH 3/4] Tests --- .github/workflows/extensions_finder.yml | 33 +++++++++++++++++++++++++ .github/workflows/sniffer.yml | 33 +++++++++++++++++++++++++ .github/workflows/syntax_checker.yml | 33 +++++++++++++++++++++++++ .scrutinizer.yml | 25 ------------------- .travis.yml | 28 --------------------- 5 files changed, 99 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/extensions_finder.yml create mode 100644 .github/workflows/sniffer.yml create mode 100644 .github/workflows/syntax_checker.yml delete mode 100644 .scrutinizer.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/extensions_finder.yml b/.github/workflows/extensions_finder.yml new file mode 100644 index 0000000..c35efa3 --- /dev/null +++ b/.github/workflows/extensions_finder.yml @@ -0,0 +1,33 @@ +name: PHPstan + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: [ '7.1', '7.2', '7.3', '7.4' ] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + + - name: Validate composer.json + run: composer validate --strict + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-interaction + + - name: PHP extensions finder + run: vendor/bin/php-extensions-finder check src bin tests diff --git a/.github/workflows/sniffer.yml b/.github/workflows/sniffer.yml new file mode 100644 index 0000000..4e1c880 --- /dev/null +++ b/.github/workflows/sniffer.yml @@ -0,0 +1,33 @@ +name: PHPstan + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: [ '7.1', '7.2', '7.3', '7.4' ] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + + - name: Validate composer.json + run: composer validate --strict + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-interaction + + - name: Check syntax + run: find src bin tests -name "*.php" -print0 | xargs -0 -n1 -P8 php -l diff --git a/.github/workflows/syntax_checker.yml b/.github/workflows/syntax_checker.yml new file mode 100644 index 0000000..54a52e5 --- /dev/null +++ b/.github/workflows/syntax_checker.yml @@ -0,0 +1,33 @@ +name: PHPstan + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: [ '7.1', '7.2', '7.3', '7.4' ] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + + - name: Validate composer.json + run: composer validate --strict + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-interaction + + - name: Code sniffer + run: vendor/bin/phpcs src bin --standard=PSR2 -n diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index df6cfa0..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,25 +0,0 @@ -filter: - excluded_paths: [tests/*] - -checks: - php: - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true - code_rating: true - duplication: true - -tools: - external_code_coverage: - timeout: 600 - runs: 2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6f48df4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: php - -services: - - mysql - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - -sudo: false - -before_script: - - travis_retry composer self-update - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction - -script: - - mkdir -p build/logs - - php vendor/bin/phpcs src/ --standard=PSR2 -n - - mysql -u root -e "DROP DATABASE IF EXISTS parallel_test" - - mysql -u root -e "CREATE DATABASE parallel_test" -# - mysql -u root parallel_test < tests/Data/structure.sql - - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover - -after_script: - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover coverage.clover From 614b8ca37b29fc56edb3b38b831dcda22617910a Mon Sep 17 00:00:00 2001 From: Samuel kelemen Date: Tue, 2 Nov 2021 09:07:50 +0100 Subject: [PATCH 4/4] Tests naming --- .github/workflows/extensions_finder.yml | 2 +- .github/workflows/sniffer.yml | 2 +- .github/workflows/syntax_checker.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/extensions_finder.yml b/.github/workflows/extensions_finder.yml index c35efa3..7bb4dbb 100644 --- a/.github/workflows/extensions_finder.yml +++ b/.github/workflows/extensions_finder.yml @@ -1,4 +1,4 @@ -name: PHPstan +name: Extensions finder on: push: diff --git a/.github/workflows/sniffer.yml b/.github/workflows/sniffer.yml index 4e1c880..1a713fa 100644 --- a/.github/workflows/sniffer.yml +++ b/.github/workflows/sniffer.yml @@ -1,4 +1,4 @@ -name: PHPstan +name: Sniffer on: push: diff --git a/.github/workflows/syntax_checker.yml b/.github/workflows/syntax_checker.yml index 54a52e5..8b206d8 100644 --- a/.github/workflows/syntax_checker.yml +++ b/.github/workflows/syntax_checker.yml @@ -1,4 +1,4 @@ -name: PHPstan +name: Syntax checker on: push: