Skip to content

Commit

Permalink
Laravel 11.x Compatibility (#16)
Browse files Browse the repository at this point in the history
* Bump dependencies for Laravel 11

* Update GitHub Actions for Laravel 11
  • Loading branch information
laravel-shift authored Mar 2, 2024
1 parent 8cffa8e commit 419e60e
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 86 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/gen-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ name: gen-docs

on:
workflow_dispatch:
# push:
# tags:
# - '*'

jobs:
docs:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [8.0]
php: [8.0, '8.2']

name: Docs P${{ matrix.php }}

steps:
Expand All @@ -38,6 +37,6 @@ jobs:
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
BRANCH: gh-pages
FOLDER: docs
CLEAN: true
46 changes: 36 additions & 10 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@ name: run-tests

on:
push:
branches: [master]
branches:
- master
pull_request:
branches: [master]

# # https://levelup.gitconnected.com/how-to-manually-trigger-a-github-actions-workflow-4712542f1960
# on:
# workflow_dispatch:
branches:
- master

jobs:
tests:

runs-on: ubuntu-latest


strategy:
fail-fast: true
matrix:
php: [8.1, 8.0]
laravel: [^10.0, ^9.0, ^8.0, ^7.0]
php: [8.0, 8.1, '8.2']
laravel: ['11.0', ^7.0, ^8.0, ^9.0, ^10.0]
include:
- laravel: ^10.0
testbench: ^8.0
Expand All @@ -27,19 +28,30 @@ jobs:
testbench: ^6.0
- laravel: ^7.0
testbench: ^5.0
- laravel: '11.0'
testbench: ^9.0
exclude:
- laravel: ^10.0
php: 8.0
- laravel: ^7.0
php: 8.1
- laravel: '11.0'
php: 8.0
- laravel: '11.0'
php: 8.1


name: TESTS PHP ${{ matrix.php }} LARAVEL ${{ matrix.laravel }} TESTBENCH ${{ matrix.testbench }}


steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false


- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -48,29 +60,33 @@ jobs:
tools: composer:v2
coverage: pcov


- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}


- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-progress --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Create tests database
run: |
mkdir -p database
touch database/database.sqlite
# https://blog.shaharia.com/github-actions-workflows-ci-for-php-developer
- name: Execute tests, generate code coverage report
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover


- name: Save code coverage report
uses: actions/upload-artifact@v3
with:
Expand All @@ -79,26 +95,36 @@ jobs:

coverage:
needs: tests

runs-on: ubuntu-latest


strategy:
fail-fast: true
matrix:
php: [7.4]
php: [7.4, '8.2']


name: Coverage P${{ matrix.php }}


steps:
- name: Checkout code
uses: actions/checkout@v3


- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}


- name: Retrieve code coverage report
uses: actions/download-artifact@v3
with:
name: coverage


- name: Upload code coverage report
run: |
wget https://scrutinizer-ci.com/ocular.phar
Expand Down
138 changes: 69 additions & 69 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
{
"name": "bmatovu/laravel-xml",
"description": "Laravel XML Support",
"homepage": "https://github.com/mtvbrianking/laravel-xml",
"type": "library",
"license": "MIT",
"keywords": [
"laravel",
"package",
"xml",
"request",
"response",
"middleware"
],
"authors": [
{
"name": "Brian Matovu",
"email": "[email protected]",
"homepage": "https://bmatovu.com",
"role": "Developer"
}
],
"require": {
"php": "^8.0",
"illuminate/http": "^7.0|^8.0|^9.0|^10.0",
"illuminate/support": "^7.0|^8.0|^9.0|^10.0",
"illuminate/database": "^7.0|^8.0|^9.0|^10.0"
},
"require-dev": {
"code-lts/doctum": "^5.5",
"friendsofphp/php-cs-fixer": "^3.14",
"laravel/framework": "^10.0",
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^8.4|^9.0|^10.0"
},
"autoload": {
"psr-4": {
"Bmatovu\\LaravelXml\\": "src/"
"name": "bmatovu/laravel-xml",
"description": "Laravel XML Support",
"homepage": "https://github.com/mtvbrianking/laravel-xml",
"type": "library",
"license": "MIT",
"keywords": [
"laravel",
"package",
"xml",
"request",
"response",
"middleware"
],
"authors": [
{
"name": "Brian Matovu",
"email": "[email protected]",
"homepage": "https://bmatovu.com",
"role": "Developer"
}
],
"require": {
"php": "^8.0",
"illuminate/http": "^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/database": "^7.0|^8.0|^9.0|^10.0|^11.0"
},
"files": [
"src/Support/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Bmatovu\\LaravelXml\\Test\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"cs-fix": "php-cs-fixer fix",
"cs-lint": "php-cs-fixer fix --dry-run",
"doc": "doctum.php update doctum.php -v",
"test": "phpunit",
"test-coverage": "phpunit --coverage-html build/coverage"
},
"config": {
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "4.x-dev"
"require-dev": {
"code-lts/doctum": "^5.5",
"friendsofphp/php-cs-fixer": "^3.14",
"laravel/framework": "^10.0|^11.0",
"orchestra/testbench": "^8.0|^9.0",
"phpunit/phpunit": "^8.4|^9.0|^10.0"
},
"autoload": {
"psr-4": {
"Bmatovu\\LaravelXml\\": "src/"
},
"files": [
"src/Support/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Bmatovu\\LaravelXml\\Test\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"cs-fix": "php-cs-fixer fix",
"cs-lint": "php-cs-fixer fix --dry-run",
"doc": "doctum.php update doctum.php -v",
"test": "phpunit",
"test-coverage": "phpunit --coverage-html build/coverage"
},
"config": {
"sort-packages": true
},
"laravel": {
"providers": [
"Bmatovu\\LaravelXml\\LaravelXmlServiceProvider"
],
"aliases": {
"Xml": "Bmatovu\\LaravelXml\\LaravelXml"
}
"extra": {
"branch-alias": {
"dev-master": "4.x-dev"
},
"laravel": {
"providers": [
"Bmatovu\\LaravelXml\\LaravelXmlServiceProvider"
],
"aliases": {
"Xml": "Bmatovu\\LaravelXml\\LaravelXml"
}
}
}
}
}

0 comments on commit 419e60e

Please sign in to comment.