Skip to content

Commit

Permalink
feat: prepare to Laravel 9 (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Jan 14, 2022
1 parent 1c61b37 commit 9e9f22b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [8.0]
php-version: [8.1]

steps:
- name: Checkout sources
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [8.0]
php-version: [8.1]

steps:
- name: Checkout sources
Expand Down
39 changes: 23 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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') }}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -90,9 +95,6 @@ jobs:
reporting:
needs: tests
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [8.0]

steps:
- name: Checkout repository
Expand Down Expand Up @@ -129,16 +131,21 @@ 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
env:
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
Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -54,7 +54,10 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"composer/package-versions-deprecated": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
41 changes: 15 additions & 26 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="true"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
>
<testsuites>
<testsuite name="LaravelSabre Tests Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="base64:uA/XEme0vpegJz/rKSk3ys2uzEfXZA0Ca2P0e1M8vRU="/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" beStrictAboutTestsThatDoNotTestAnything="true" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnError="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="LaravelSabre Tests Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="base64:uA/XEme0vpegJz/rKSk3ys2uzEfXZA0Ca2P0e1M8vRU="/>
</php>
</phpunit>

0 comments on commit 9e9f22b

Please sign in to comment.