Skip to content

Commit

Permalink
Add Laravel 11 support (#593)
Browse files Browse the repository at this point in the history
* Add Laravel 11 support

* add 8.2 and 8.3 tests

* format

* check if env is available

* check if env is available

* latest

* use 8.3 for codeclimate run

* only run code coverage report on master

* only run code coverage report on master

* fix coveralls report path

---------

Co-authored-by: pataar <[email protected]>
Co-authored-by: Darius Matulionis <[email protected]>
  • Loading branch information
3 people authored Mar 13, 2024
1 parent 96fcc40 commit 76ce7aa
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 33 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/test-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ '7.4', '8.0', '8.1' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
l5-swagger-flags: ['latest', 'swagger-php-3', 'swagger-ui-3']

name: PHP ${{ matrix.php }} - ${{ matrix.l5-swagger-flags }}
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
if: matrix.php == '8.1' && matrix.l5-swagger-flags == 'latest'
if: matrix.php == '8.3' && matrix.l5-swagger-flags == 'latest'

- name: Run test suite
run: composer run-script phpunit
Expand All @@ -77,10 +77,12 @@ jobs:
cp ${{github.workspace}}/tests/storage/logs/test-reports/clover.xml ${{github.workspace}}/clover.xml
./cc-test-reporter after-build -t clover --exit-code 0
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r ${{github.workspace}}/clover.xml
if: matrix.php == '8.1' && matrix.l5-swagger-flags == 'latest'
if: matrix.php == '8.3' && matrix.l5-swagger-flags == 'latest' && github.event_name != 'pull_request'

- name: Publish coveralls report
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: vendor/bin/php-coveralls --coverage_clover=clover.xml -v
if: matrix.php == '8.1' && matrix.l5-swagger-flags == 'latest'
run: |
cp ${{github.workspace}}/tests/storage/logs/test-reports/clover.xml ${{github.workspace}}/clover.xml
vendor/bin/php-coveralls --coverage_clover=clover.xml -v
if: matrix.php == '8.3' && matrix.l5-swagger-flags == 'latest'
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Base install
#
FROM amd64/php:8.1-apache as base
FROM amd64/php:8.2-apache as base

LABEL vendor="L5 Swagger"

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
],
"require": {
"php": "^7.2 || ^8.0",
"laravel/framework": "^10.0 || ^9.0 || >=8.40.0 || ^7.0",
"laravel/framework": "^11.0 || ^10.0 || ^9.0 || >=8.40.0 || ^7.0",
"zircote/swagger-php": "^3.2.0 || ^4.0.0",
"swagger-api/swagger-ui": "^3.0 || >=4.1.3",
"symfony/yaml": "^5.0 || ^6.0 || ^7.0",
"ext-json": "*",
"doctrine/annotations": "^1.0 || ^2.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0 || ^9.5",
"phpunit/phpunit": "^11.0 || ^10.0 || ^9.5",
"mockery/mockery": "1.*",
"orchestra/testbench": "^8.0 || 7.* || ^6.15 || 5.*",
"orchestra/testbench": "^9.0 || ^8.0 || 7.* || ^6.15 || 5.*",
"php-coveralls/php-coveralls": "^2.0"
},
"autoload": {
Expand Down
49 changes: 25 additions & 24 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
stopOnFailure="false"
cacheDirectory=".phpunit.cache"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
stopOnFailure="false"
cacheDirectory=".phpunit.cache"
>
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<clover outputFile="tests/storage/logs/test-reports/clover.xml"/>
<html outputDirectory="tests/storage/logs/test-reports" lowUpperBound="50" highLowerBound="80"/>
</report>
</coverage>
<testsuite name="L5-Swagger TestSuite">
<directory>tests/</directory>
</testsuite>
<logging/>
<php>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="SWAGGER_VERSION" value="3.0"/>
</php>
<coverage>
<report>
<clover outputFile="tests/storage/logs/test-reports/clover.xml"/>
<html outputDirectory="tests/storage/logs/test-reports" lowUpperBound="50" highLowerBound="80"/>
</report>
</coverage>
<testsuite name="L5-Swagger TestSuite">
<directory>tests/</directory>
</testsuite>
<logging/>
<php>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="SWAGGER_VERSION" value="3.0"/>
</php>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>

0 comments on commit 76ce7aa

Please sign in to comment.