From 9e9f22bdeb0fccb585aa0f5c1cc92b85d23eacb0 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Fri, 14 Jan 2022 21:10:39 +0100 Subject: [PATCH] feat: prepare to Laravel 9 (#109) --- .github/workflows/static.yml | 4 ++-- .github/workflows/tests.yml | 39 ++++++++++++++++++++-------------- composer.json | 7 ++++-- phpunit.xml | 41 +++++++++++++----------------------- 4 files changed, 45 insertions(+), 46 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index a3e78f7..58d294f 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: [8.0] + php-version: [8.1] steps: - name: Checkout sources @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: [8.0] + php-version: [8.1] steps: - name: Checkout sources diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1621db4..1370e01 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,20 +14,26 @@ on: types: - created +env: + default-php-version: '8.1' + default-laravel-version: '8.*' + semantic-node-version: 16 + + jobs: tests: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - php-version: [7.3, 7.4, 8.0] - laravel_version: [6.*, 7.*, 8.*] - composer_flags: ['', '--prefer-lowest'] + php-version: ['7.4', '8.0', '8.1'] + laravel_version: [7.*, 8.*, 9.*] exclude: - - php-version: 7.3 - laravel_version: 8.* - composer_flags: --prefer-lowest - name: PHP ${{ matrix.php-version }} | Laravel ${{ matrix.laravel_version }} ${{ matrix.composer_flags }} + - php-version: 7.4 + laravel_version: 9.* + - php-version: 8.1 + laravel_version: 7.* + name: PHP ${{ matrix.php-version }} | Laravel ${{ matrix.laravel_version }} steps: - name: Checkout sources @@ -56,9 +62,8 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}-${{ matrix.laravel_version }}-${{ matrix.composer_flags }} + key: ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}-${{ matrix.laravel_version }} restore-keys: | - ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}-${{ matrix.laravel_version }}-${{ matrix.composer_flags }} ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}-${{ matrix.laravel_version }} ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }} ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }} @@ -67,7 +72,7 @@ jobs: - name: Install dependencies with Laravel ${{ matrix.laravel_version }} run: | export COMPOSER_ROOT_VERSION=dev-master - composer require "laravel/framework:${{ matrix.laravel_version }}" --no-interaction --no-progress --prefer-stable --prefer-dist ${{ matrix.composer_flags }} + composer require "laravel/framework:${{ matrix.laravel_version }}" --no-interaction --no-progress --prefer-stable --prefer-dist - name: Run test suite run: phpdbg -dmemory_limit=4G -qrr vendor/bin/phpunit -c phpunit.xml --log-junit ./results/results.xml --coverage-clover ./results/coverage.xml @@ -77,7 +82,7 @@ jobs: working-directory: results - name: Store results - if: matrix.php-version == '8.0' && matrix.laravel_version == '8.*' && matrix.composer_flags == '' + if: matrix.php-version == env.default-php-version && matrix.laravel_version == env.default-laravel-version uses: actions/upload-artifact@v2 with: name: results @@ -90,9 +95,6 @@ jobs: reporting: needs: tests runs-on: ubuntu-latest - strategy: - matrix: - php-version: [8.0] steps: - name: Checkout repository @@ -129,6 +131,11 @@ jobs: with: fetch-depth: 0 # Get all tags + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ env.semantic-node-version }} + - name: Semantic Release uses: cycjimmy/semantic-release-action@v2 id: semantic @@ -136,9 +143,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN_RELEASE: ${{ secrets.GH_TOKEN_RELEASE }} with: - semantic_version: 17.3.7 + semantic_version: 18 extra_plugins: | - @semantic-release/changelog + @semantic-release/changelog@6 semantic-release-github-pullrequest - name: New release published diff --git a/composer.json b/composer.json index 3380649..9697c43 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "mockery/mockery": "^1.4", "nunomaduro/larastan": "^0.4 || ^0.5 || ^0.6 || ^0.7", "ocramius/package-versions": "^1.9 || ^2.0", - "orchestra/testbench": "^3.5 || ^5.0 || ^6.0", + "orchestra/testbench": "^3.5 || ^5.0 || ^6.0 || ^7.0", "phpstan/phpstan-deprecation-rules": "^0.12", "phpstan/phpstan-phpunit": "^0.12", "phpstan/phpstan-strict-rules": "^0.12", @@ -54,7 +54,10 @@ } }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "composer/package-versions-deprecated": true + } }, "minimum-stability": "dev", "prefer-stable": true diff --git a/phpunit.xml b/phpunit.xml index c148449..6e04628 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,28 +1,17 @@ - - - - ./tests - - - - - ./src - - - - - - + + + + ./src + + + + + ./tests + + + + + +