Skip to content

Commit

Permalink
add support to Laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
d8vjork committed Mar 21, 2024
1 parent d2952fd commit 5997676
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 101 deletions.
File renamed without changes.
19 changes: 10 additions & 9 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: phpstan

on: [ push, pull_request ]
on: [push, pull_request]

jobs:
analyze:
Expand All @@ -9,28 +9,29 @@ jobs:
name: PHPStan

steps:
- uses: actions/checkout@v4
- name: 🏗 Checkout code
uses: actions/checkout@v4

- name: Setup PHP
- name: 🏗 Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: "8.3"
coverage: none
tools: phpstan

- name: Get composer cache directory
- name: 🏗 Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
- name: 🏗 Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: phpstan-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: phpstan-composer-

- name: Install dependencies
- name: 📦 Install dependencies
run: composer install --no-interaction --no-suggest

- name: Run analysis
- name: 🧪 Analyse code
run: phpstan analyse
11 changes: 6 additions & 5 deletions .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pint

on: [ push, pull_request ]
on: [push, pull_request]

jobs:
analyze:
Expand All @@ -9,14 +9,15 @@ jobs:
name: Laravel Pint

steps:
- uses: actions/checkout@v4
- name: 🏗 Checkout code
uses: actions/checkout@v4

- name: Setup PHP
- name: 🏗 Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: "8.3"
coverage: none
tools: laravel/pint

- name: Run analysis
- name: 🧪 Analyse code
run: pint
38 changes: 32 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,50 @@ name: Publish
on:
push:
tags:
- '**'
- "**"

jobs:
# @see https://stackoverflow.com/a/72959712/8179249
check-current-branch:
runs-on: ubuntu-latest

outputs:
branch: ${{ steps.check_step.outputs.branch }}

steps:
- name: 🏗 Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🏗 Get current branch
id: check_step
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch="$(echo ${raw//origin\//} | tr -d '\n')"
echo "{name}=branch" >> $GITHUB_OUTPUT
echo "Branches where this tag exists : $branch."
build:
runs-on: ubuntu-latest

needs: check-current-branch

steps:
- uses: actions/checkout@v4
- name: 🏗 Checkout code
uses: actions/checkout@v4

- name: Get release info
- name: 🏗 Get release info
id: query-release-info
uses: release-flow/keep-a-changelog-action@v2
uses: release-flow/keep-a-changelog-action@v3
with:
command: query
version: latest

- name: Publish to Github releases
uses: softprops/action-gh-release@v1
- name: 🚀 Publish to Github releases
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.query-release-info.outputs.release-notes }}
make_latest: contains(${{ needs.check.outputs.branch }}, 'main')
# prerelease: true
# files: '*.vsix'
52 changes: 30 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: tests

on: [ push, pull_request ]
on: [push, pull_request]

jobs:
test:
Expand All @@ -9,56 +9,64 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.1, 8.2, 8.3 ]
laravel: [ 9.*, 10.* ]
dependency-version: [ prefer-stable ]
os: [ubuntu-latest]
php: [8.0, 8.1, 8.2, 8.3]
stability: [prefer-stable]
laravel: [9.*, 10.*, 11.*]
include:
- laravel: 9.*
testbench: 7.*

- laravel: 10.*
testbench: 8.*

- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 10.*
php: 8.0
- php: 8.0
laravel: 10.*

- php: 8.0
laravel: 11.*

- php: 8.1
laravel: 11.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

steps:
- name: Checkout code
- name: 🏗 Checkout code
uses: actions/checkout@v4

- name: Setup PHP
- name: 🏗 Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, exif
coverage: pcov

- name: Get composer cache directory
- name: 🏗 Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
- name: 🏗 Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.dependency-version }}-
key: dependencies-composer-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.lock') }}
restore-keys: dependencies-composer-laravel-${{ matrix.laravel }}-

- name: Install dependencies
- name: 📦 Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
composer update --prefer-dist --no-interaction --no-progress --${{ matrix.stability }}
- name: Execute tests
- name: 🧪 Execute tests
run: vendor/bin/phpunit -c phpunit.coverage.dist.xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
- name: 🚀 Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./clover.xml
fail_ci_if_error: true
verbose: true
# verbose: true
119 changes: 60 additions & 59 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,62 @@
{
"name": "open-southeners/carbone-sdk",
"description": "Unofficial port of the Carbone API SDK to Saloon v3",
"license": "MIT",
"keywords": [
"open-southeners",
"carbone",
"carbone-sdk",
"carbone-client",
"carbone-api",
"word",
"excel",
"office",
"pdf",
"generator"
],
"authors": [
{
"name": "Ruben Robles",
"email": "me@d8vjork.com",
"homepage": "https://d8vjork.com"
}
],
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/open-southeners"
}
],
"require": {
"php": "^8.0",
"saloonphp/saloon": "^3.0"
},
"require-dev": {
"orchestra/testbench": "^7.0 || ^8.0",
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^9.0 || ^10.0",
"tomasvotruba/type-coverage": "^0.2"
},
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"OpenSoutheners\\CarboneSdk\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"OpenSoutheners\\CarboneSdk\\Tests\\": "tests"
}
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"OpenSoutheners\\CarboneSdk\\ServiceProvider"
]
}
"name": "open-southeners/carbone-sdk",
"description": "Unofficial port of the Carbone API SDK to Saloon v3",
"license": "MIT",
"keywords": [
"open-southeners",
"carbone",
"carbone-sdk",
"carbone-client",
"carbone-api",
"word",
"excel",
"office",
"pdf",
"generator"
],
"authors": [
{
"name": "Ruben Robles",
"email": "me@d8vjork.com",
"homepage": "https://d8vjork.com"
}
}
],
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/open-southeners"
}
],
"require": {
"php": "^8.0",
"saloonphp/saloon": "^3.0"
},
"require-dev": {
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0",
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^9.0 || ^10.0",
"tomasvotruba/type-coverage": "^0.2"
},
"minimum-stability": "stable",
"prefer-stable": true,
"autoload": {
"psr-4": {
"OpenSoutheners\\CarboneSdk\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"OpenSoutheners\\CarboneSdk\\Tests\\": "tests"
}
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"OpenSoutheners\\CarboneSdk\\ServiceProvider"
]
}
}
}

0 comments on commit 5997676

Please sign in to comment.