Skip to content

Commit

Permalink
Add L10 support, remove L6 and L8 support (#11)
Browse files Browse the repository at this point in the history
* Add L10 support

* Update PHP version in ci.yml

* Update ci.yml

* Revert ci.yml changes

* Migrate PHPUnit XML config using "--migrate-configuration"

* Update phpunit.xml (delete cacheDirectory, use backupStaticAttributes instead of backupStaticProperties)

* Delete backupStaticAttributes

* Add PHP version matrix

* Use ci.yml from #12

* Correct Laravel matrix versions

* Revert ci.yml changes

* Use multiple PHP versions

* Update ci.yml

* Don't use PHP 8 with Laravel 10 in CI

* Update ci.yml

* Remove L6 and L8 support

* Use single PHP version in CI

* Update ci.yml

* Change matrix in ci.yml

* swap laravel 9 & 10

* Update README.md

---------

Co-authored-by: Samuel Štancl <[email protected]>
  • Loading branch information
lukinovec and stancl authored Feb 16, 2023
1 parent 46c590e commit 0b10890
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 43 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ name: run-tests
on: [push, pull_request]

jobs:
test:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
laravel: [6, 8, 9]

include:
- laravel: 9
php: 8.0
- laravel: 10
php: 8.1

name: Tests (PHPUnit) - L${{ matrix.laravel }}

Expand All @@ -20,7 +23,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: ${{matrix.php}}

- name: Install dependencies
run: composer require "laravel/framework:^${{matrix.laravel}}.0"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Installation

Supports Laravel 6, 7, 8, and 9.
Supports Laravel 9 and 10.

```
composer require stancl/virtualcolumn
Expand All @@ -20,7 +20,7 @@ class MyModel extends Model
use VirtualColumn;

public $guarded = [];

public static function getCustomColumns(): array
{
return [
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
}
},
"require": {
"illuminate/support": "^6.0|^8.0|^9.0",
"illuminate/database": "^6.0|^8.0|^9.0"
"illuminate/support": "^9.0|^10.0",
"illuminate/database": "^9.0|^10.0"
},
"require-dev": {
"orchestra/testbench": "^4.0|^6.0|^7.0"
"orchestra/testbench": "^7.0|^8.0"
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
60 changes: 26 additions & 34 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
<exclude>
<file>./src/routes.php</file>
</exclude>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="redis"/>
<env name="MAIL_DRIVER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="AWS_DEFAULT_REGION" value="us-west-2"/>
</php>
</phpunit>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<exclude>
<file>./src/routes.php</file>
</exclude>
</coverage>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="redis"/>
<env name="MAIL_DRIVER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="AWS_DEFAULT_REGION" value="us-west-2"/>
</php>
</phpunit>

0 comments on commit 0b10890

Please sign in to comment.