Skip to content

Commit

Permalink
Laravel 10 & PHP 8.2 only (#22)
Browse files Browse the repository at this point in the history
* Laravel 10 & PHP 8.2 Only
  • Loading branch information
StanBarrows authored May 15, 2023
1 parent e3d9ec4 commit cea3799
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 72 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:

- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]

uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-merge Dependabot PRs for semver-minor updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Auto-merge Dependabot PRs for semver-patch updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: Check & fix styling
name: Fix PHP code style issues

on:
push:
branches:
- styling
on: [push]

jobs:
php-cs-fixer:
php-code-styling:
runs-on: ubuntu-latest

steps:
Expand All @@ -15,10 +12,8 @@ jobs:
with:
ref: ${{ github.head_ref }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php-cs-fixer.dist.php --allow-risky=yes
- name: Fix PHP code style issues
uses: aglipanci/[email protected]

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
phpstan:
Expand All @@ -16,11 +16,11 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v1
uses: ramsey/composer-install@v2

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
14 changes: 6 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ jobs:
strategy:
fail-fast: true
matrix:
# os: [ ubuntu-latest, windows-latest ]
os: [ ubuntu-latest ]
php: [ 8.1 ]
laravel: [ 9.* ]
#stability: [ prefer-lowest, prefer-stable ]
stability: [ prefer-stable ]
os: [ ubuntu-latest, windows-latest ]
php: [ 8.2 ]
laravel: [ 10.* ]
stability: [ prefer-lowest, prefer-stable ]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*

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

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ features to manage customer communication.

## 🛠 Requirements

| Version | v2.0.0 | v1.0.0 |
|---------|--------|---------|
| PHP | `^8.1` | `^8.0` |
| Laravel| `^9.0` | `^8.12` |
| Zammad Access|||
| Package | PHP | Laravel | Zammad |
|-----------|--------|------------------|----------|
| >v3.0 | >8.2 | > Laravel 10.0 | |
| >v2.0 | >8.1 | > Laravel 9.0 | |
| >v1.0 | >8.0 | > Laravel 8.12 | |

## ⚙️ Installation

Expand Down
26 changes: 10 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,26 @@
"email": "[email protected]",
"homepage": "https://www.codebar.ch",
"role": "Developer"
},
{
"name": "Ruslan Steiger",
"role": "Developer"
}
],
"require": {
"php": "^8.1",
"guzzlehttp/guzzle": "^7.0",
"illuminate/contracts": "^9.0",
"php": "^8.2",
"guzzlehttp/guzzle": "^7.5",
"illuminate/contracts": "^10.0",
"spatie/laravel-package-tools": "^1.9.2"
},
"require-dev": {
"brianium/paratest": "^6.2",
"friendsofphp/php-cs-fixer": "^3.8",
"laravel/pint": "^0.2.3",
"nunomaduro/collision": "^6.0",
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.9",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^7.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"orchestra/testbench": "^8.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-arch": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5",
"spatie/laravel-ray": "^1.9"
"spatie/laravel-ray": "^1.26"
},
"autoload": {
"psr-4": {
Expand Down
34 changes: 11 additions & 23 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,32 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
executionOrder="random"
failOnWarning="true"
failOnRisky="true"
failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" backupGlobals="false"
bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false"
executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="CodebarAg Test Suite">
<testsuite name="codebar Solutions AG Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
Expand All @@ -40,4 +23,9 @@
<env name="ZAMMAD_URL" value="https://domain.zammad.com"/>
<env name="ZAMMAD_TOKEN" value="token"/>
</php>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion tests/Feature/ObjectAttributeResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
Event::assertDispatched(ZammadResponseLog::class, 2);
})->group('objects');

# this test is migrating the zammad database which can take up to 30seconds.
// this test is migrating the zammad database which can take up to 30seconds.
it('execute database migrations', function () {
(new Zammad())->object()->executeMigrations();
Event::assertDispatched(ZammadResponseLog::class, 1);
Expand Down

0 comments on commit cea3799

Please sign in to comment.