Skip to content

Commit

Permalink
Laravel 11 support was added (#16)
Browse files Browse the repository at this point in the history
* Laravel 11 support was added

* Specify php version for Laravel 10

---------

Co-authored-by: Dmitry Peichev <[email protected]>
  • Loading branch information
helloween141 and Dmitry Peichev authored May 31, 2024
1 parent b40dbaf commit 9490190
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 46 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ jobs: # Docs: <https://git.io/JvxXE>
setup: [basic, lowest]
laravel: [default]
coverage: [yes]
php: ['8.0', '8.1', '8.2']
php: ['8.1', '8.2', '8.3']
include:
- php: '8.1'
setup: [ basic, lowest ]
coverage: no
laravel: '^10.0'
steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -37,7 +42,7 @@ jobs: # Docs: <https://git.io/JvxXE>
run: echo "output_dir=dir::$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies # Docs: <https://git.io/JfAKn#php---composer>
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.output_dir }}
key: ${{ runner.os }}-composer-${{ matrix.setup }}-${{ hashFiles('**/composer.json') }}
Expand Down Expand Up @@ -68,7 +73,7 @@ jobs: # Docs: <https://git.io/JvxXE>
XDEBUG_MODE: coverage
run: composer test-cover

- uses: codecov/codecov-action@v3 # Docs: <https://github.com/codecov/codecov-action>
- uses: codecov/codecov-action@v4 # Docs: <https://github.com/codecov/codecov-action>
if: matrix.coverage == 'yes'
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].

## Unreleased

### Added

- Laravel `11.x` support

### Changed

- Minimal Laravel version now is `10.0`
- Version of `composer` in docker container updated up to `2.7.6`
- Updated dev dependencies

## v2.5.0

### Added
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM php:8.0-alpine
FROM php:8.3-alpine

ENV COMPOSER_HOME="/tmp/composer"

COPY --from=composer:2.6.5 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2.7.6 /usr/bin/composer /usr/bin/composer

RUN set -x \
&& apk add --no-cache binutils git \
&& apk add --no-cache --virtual .build-deps linux-headers autoconf pkgconf make g++ gcc 1>/dev/null \
# install xdebug (for testing with code coverage), but do not enable it
&& pecl install xdebug-3.2.0 1>/dev/null \
&& pecl install xdebug-3.3.0 1>/dev/null \
&& apk del .build-deps \
&& mkdir --parents --mode=777 /src ${COMPOSER_HOME}/cache/repo ${COMPOSER_HOME}/cache/files \
&& ln -s /usr/bin/composer /usr/bin/c \
Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
}
],
"require": {
"php": "^8.0.2",
"php": "^8.1",
"ext-json": "*",
"illuminate/contracts": "~9.0 || ~10.0",
"illuminate/support": "~9.0 || ~10.0",
"illuminate/http": "~9.0 || ~10.0",
"illuminate/routing": "~9.0 || ~10.0"
"illuminate/contracts": "~10.0 || ~11.0",
"illuminate/support": "~10.0 || ~11.0",
"illuminate/http": "~10.0 || ~11.0",
"illuminate/routing": "~10.0 || ~11.0"
},
"require-dev": {
"laravel/laravel": "~9.1 || ~10.0",
"phpunit/phpunit": "^9.6 || ^10.4",
"mockery/mockery": "^1.6",
"phpstan/phpstan": "^1.10"
"laravel/laravel": "~10.0 || ~11.0",
"phpunit/phpunit": "^10.5",
"mockery/mockery": "^1.6.5",
"phpstan/phpstan": "^1.10.66"
},
"autoload": {
"psr-4": {
Expand Down
58 changes: 27 additions & 31 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
bootstrap="./tests/bootstrap.php"
colors="true"
forceCoversAnnotation="true">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>

<coverage includeUncoveredFiles="false" processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
</exclude>
<report>
<clover outputFile="./coverage/clover.xml"/>
<html outputDirectory="./coverage/html"/>
<text outputFile="php://stdout" showUncoveredFiles="false"/>
<xml outputDirectory="./coverage/xml"/>
</report>
</coverage>

<php>
<server name="APP_ENV" value="testing" force="true"/>
<server name="APP_DEBUG" value="true" force="true"/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd" bootstrap="./tests/bootstrap.php" colors="true" cacheDirectory=".phpunit.cache" requireCoverageMetadata="true">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<coverage includeUncoveredFiles="false">
<report>
<clover outputFile="./coverage/clover.xml"/>
<html outputDirectory="./coverage/html"/>
<text outputFile="php://stdout" showUncoveredFiles="false"/>
<xml outputDirectory="./coverage/xml"/>
</report>
</coverage>
<php>
<server name="APP_ENV" value="testing" force="true"/>
<server name="APP_DEBUG" value="true" force="true"/>
</php>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
</exclude>
</source>
</phpunit>

0 comments on commit 9490190

Please sign in to comment.