From f3e99bccf5a8fd39e13d6f34ab9852c914ef3161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20G=C3=B6r=C3=B6g?= Date: Fri, 6 Mar 2020 11:04:56 +0100 Subject: [PATCH 1/6] Fix dependencies --- .github/workflows/{code_checks.yml => validate.yml} | 8 +++++--- composer.json | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) rename .github/workflows/{code_checks.yml => validate.yml} (90%) diff --git a/.github/workflows/code_checks.yml b/.github/workflows/validate.yml similarity index 90% rename from .github/workflows/code_checks.yml rename to .github/workflows/validate.yml index 23aa584..a65ecf3 100644 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/validate.yml @@ -2,9 +2,11 @@ name: PHP Composer on: push: - branches: [ master ] + branches: + - 'master' pull_request: - branches: [ master ] + branches: + - 'master' jobs: build: @@ -36,7 +38,7 @@ jobs: - name: Install dependencies run: | - composer require "illuminate/support:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" --no-interaction --no-update + composer require "illuminate/support:${{ matrix.laravel }}" "illuminate/http:${{ matrix.laravel }}" --no-interaction --no-update composer update --prefer-dist --no-interaction --no-suggest - name: Run test diff --git a/composer.json b/composer.json index 2a4f4c4..2dcfd68 100644 --- a/composer.json +++ b/composer.json @@ -19,8 +19,8 @@ ], "require": { "php": "^7.1", - "illuminate/support": "^5.5 || ^6.0", - "illuminate/http": "^5.5 || ^6.0" + "illuminate/support": "^5.5 || ^6.0 || ^7.0", + "illuminate/http": "^5.5 || ^6.0 || ^7.0" }, "require-dev": { "orchestra/testbench": "^3.5 || ^4.0 || ^5.0", From bc330ff3c5afa5cd8f8f630d37e92b1a1bda87f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20G=C3=B6r=C3=B6g?= Date: Fri, 6 Mar 2020 12:07:49 +0100 Subject: [PATCH 2/6] Put code coverage in a different action --- .github/workflows/validate.yml | 43 +++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index a65ecf3..c455d8e 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -10,15 +10,46 @@ on: jobs: build: - + name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} runs-on: ubuntu-latest strategy: fail-fast: true matrix: - php: [ '7.2', '7.3', '7.4' ] - laravel: [ '5.5.*', '5.6.*', '5.7.*', '5.8.*', '^6.0', '^7.0' ] + php: [ '7.2', '7.3', '7.4' ] + laravel: [ '5.5.*', '5.6.*', '5.7.*', '5.8.*', '^6.0', '^7.0' ] - name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v1 + with: + path: ~/.composer/cache/files + key: laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - uses: shivammathur/setup-php@v1 + with: + php-version: ${{ matrix.php }} + coverage: none + + - name: Validate composer.json + run: composer validate + + - name: Install dependencies + run: | + composer require "illuminate/support:${{ matrix.laravel }}" "illuminate/http:${{ matrix.laravel }}" --no-interaction --no-update + composer update --prefer-dist --no-interaction --no-suggest + + - name: Run test + run: ./vendor/bin/phpunit --verbose + + coverage: + name: Code Coverage + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [ '7.4' ] + laravel: [ '^7.0' ] steps: - uses: actions/checkout@v2 @@ -33,7 +64,7 @@ jobs: php-version: ${{ matrix.php }} coverage: xdebug - - name: Validate composer.json and composer.lock + - name: Validate composer.json run: composer validate - name: Install dependencies @@ -41,7 +72,7 @@ jobs: composer require "illuminate/support:${{ matrix.laravel }}" "illuminate/http:${{ matrix.laravel }}" --no-interaction --no-update composer update --prefer-dist --no-interaction --no-suggest - - name: Run test + - name: Run test with coverage run: ./vendor/bin/phpunit --coverage-clover=coverage.clover --verbose - name: External Code Coverage From 0e34fc5cbb16a85c9d8914e016fb55be045813db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20G=C3=B6r=C3=B6g?= Date: Fri, 6 Mar 2020 12:09:39 +0100 Subject: [PATCH 3/6] Fix matrix --- .github/workflows/validate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c455d8e..7e4bf3f 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -15,8 +15,8 @@ jobs: strategy: fail-fast: true matrix: - php: [ '7.2', '7.3', '7.4' ] - laravel: [ '5.5.*', '5.6.*', '5.7.*', '5.8.*', '^6.0', '^7.0' ] + php: [ '7.2', '7.3', '7.4' ] + laravel: [ '5.5.*', '5.6.*', '5.7.*', '5.8.*', '^6.0', '^7.0' ] steps: - uses: actions/checkout@v2 From 806ca8be64939d385d0c94f97ea29936b1b6d6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20G=C3=B6r=C3=B6g?= Date: Fri, 6 Mar 2020 14:14:55 +0100 Subject: [PATCH 4/6] Modify scrutinizer config --- .scrutinizer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 8096e16..0e6003d 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -10,5 +10,5 @@ checks: tools: external_code_coverage: - runs: 3 + runs: 1 timeout: 1200 From 8a078fc80527ba18b1c34ecff832a58914984be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20G=C3=B6r=C3=B6g?= Date: Fri, 6 Mar 2020 14:33:59 +0100 Subject: [PATCH 5/6] Modify scrutinizer config --- .github/workflows/validate.yml | 4 +--- .scrutinizer.yml | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 7e4bf3f..04943b1 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -72,10 +72,8 @@ jobs: composer require "illuminate/support:${{ matrix.laravel }}" "illuminate/http:${{ matrix.laravel }}" --no-interaction --no-update composer update --prefer-dist --no-interaction --no-suggest - - name: Run test with coverage - run: ./vendor/bin/phpunit --coverage-clover=coverage.clover --verbose - - name: External Code Coverage run: | + ./vendor/bin/phpunit --coverage-clover=coverage.clover --verbose wget https://scrutinizer-ci.com/ocular.phar php ocular.phar code-coverage:upload --format=php-clover coverage.clover diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 0e6003d..b9a4c30 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,14 +1,14 @@ filter: paths: - - 'src/*' + - 'src/' excluded_paths: - - 'tests/*' - - 'vendor/*' + - 'tests/' + dependency_paths: + - 'vendor/' checks: php: true tools: external_code_coverage: - runs: 1 - timeout: 1200 + timeout: 600 From 595be9427e2fc6ef7544d6d96ce883ae89f7fd05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20G=C3=B6r=C3=B6g?= Date: Fri, 6 Mar 2020 14:43:53 +0100 Subject: [PATCH 6/6] Try to generate coverage data in scrutinizer --- .github/workflows/validate.yml | 36 ---------------------------------- .scrutinizer.yml | 12 +++++++++--- 2 files changed, 9 insertions(+), 39 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 04943b1..68af384 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -41,39 +41,3 @@ jobs: - name: Run test run: ./vendor/bin/phpunit --verbose - - coverage: - name: Code Coverage - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - php: [ '7.4' ] - laravel: [ '^7.0' ] - - steps: - - uses: actions/checkout@v2 - - - uses: actions/cache@v1 - with: - path: ~/.composer/cache/files - key: laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - - - uses: shivammathur/setup-php@v1 - with: - php-version: ${{ matrix.php }} - coverage: xdebug - - - name: Validate composer.json - run: composer validate - - - name: Install dependencies - run: | - composer require "illuminate/support:${{ matrix.laravel }}" "illuminate/http:${{ matrix.laravel }}" --no-interaction --no-update - composer update --prefer-dist --no-interaction --no-suggest - - - name: External Code Coverage - run: | - ./vendor/bin/phpunit --coverage-clover=coverage.clover --verbose - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover diff --git a/.scrutinizer.yml b/.scrutinizer.yml index b9a4c30..1fdd5a5 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -9,6 +9,12 @@ filter: checks: php: true -tools: - external_code_coverage: - timeout: 600 +build: + nodes: + coverage: + tests: + override: + - command: ./vendor/bin/phpunit --coverage-clover=coverage.clover + coverage: + file: coverage.clover + format: clover