From afd159c52841ebf6553eb041dd050c75ede482ff Mon Sep 17 00:00:00 2001 From: Dwight Watson Date: Thu, 25 Feb 2021 10:17:54 +1100 Subject: [PATCH 1/4] Attempt to use GitHub Actions --- .github/workflows/build.yml | 44 +++++++++++++++++++++++++++++++++++++ .scrutinizer.yml | 21 ------------------ .travis.yml | 22 ------------------- phpunit.xml.dist | 37 ++++++++++--------------------- 4 files changed, 55 insertions(+), 69 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .scrutinizer.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d251536 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,44 @@ +name: build + +on: + push: + pull_request: + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + php: [8.0, 7.4, 7.3, 7.2] + laravel: [8.*, 7.*, 6.*] + dependency-version: [prefer-lowest, prefer-stable] + os: [ubuntu-latest] + include: + - laravel: 8.* + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v1 + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache/files + key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest + - name: Execute tests + run: vendor/bin/phpunit diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 6fad5be..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,21 +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 - -tools: - external_code_coverage: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7d05321..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: php - -php: - - 7.3 - - 7.4 - - 8.0 - -env: - matrix: - - COMPOSER_FLAGS="--prefer-lowest" - - COMPOSER_FLAGS="" - -before_script: - - travis_retry composer self-update - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source - -script: - - vendor/bin/phpcs --standard=PSR2 src && 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 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7645ab3..6b321a9 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,28 +1,13 @@ - - - - tests - - - - - src/ - - - - - - - - + + + + src/ + + + + + tests + + From 661d4ba7a6734eedbe2a47aa0427959e1e70c91c Mon Sep 17 00:00:00 2001 From: Dwight Watson Date: Thu, 25 Feb 2021 10:24:37 +1100 Subject: [PATCH 2/4] Allow additional versions --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 1ebe9eb..f9f7df3 100644 --- a/composer.json +++ b/composer.json @@ -13,11 +13,11 @@ "require": { "php": "^7.3|^8.0", "edamov/pushok": "^0.12", - "illuminate/cache": "^8.0", - "illuminate/config": "^8.0", - "illuminate/events": "^8.0", - "illuminate/notifications": "^8.0", - "illuminate/support": "^8.0" + "illuminate/cache": "^6.0|^7.0|^8.0", + "illuminate/config": "^6.0|^7.0|^8.0", + "illuminate/events": "^6.0|^7.0|^8.0", + "illuminate/notifications": "^6.0|^7.0|^8.0", + "illuminate/support": "^6.0|^7.0|^8.0" }, "require-dev": { "mockery/mockery": "^1.4", From 2d5c7b39dcc5a6163bc0d5b0a68fe13d633e9907 Mon Sep 17 00:00:00 2001 From: Dwight Watson Date: Thu, 25 Feb 2021 10:28:42 +1100 Subject: [PATCH 3/4] Allow PHP GTE 7.2.5 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f9f7df3..6229a29 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^7.3|^8.0", + "php": ">=7.2.5|^7.3|^8.0", "edamov/pushok": "^0.12", "illuminate/cache": "^6.0|^7.0|^8.0", "illuminate/config": "^6.0|^7.0|^8.0", From f2fd7015e9c6dbc72c0e5c6385468057f6590ec7 Mon Sep 17 00:00:00 2001 From: Dwight Watson Date: Thu, 25 Feb 2021 10:44:03 +1100 Subject: [PATCH 4/4] Drop PHP 7.2 --- .github/workflows/build.yml | 4 ++-- composer.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d251536..afb6d88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,14 +10,14 @@ jobs: strategy: fail-fast: false matrix: - php: [8.0, 7.4, 7.3, 7.2] + php: [8.0, 7.4, 7.3] laravel: [8.*, 7.*, 6.*] dependency-version: [prefer-lowest, prefer-stable] os: [ubuntu-latest] include: - laravel: 8.* - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} + name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - name: Checkout code diff --git a/composer.json b/composer.json index 6229a29..f9f7df3 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": ">=7.2.5|^7.3|^8.0", + "php": "^7.3|^8.0", "edamov/pushok": "^0.12", "illuminate/cache": "^6.0|^7.0|^8.0", "illuminate/config": "^6.0|^7.0|^8.0",