Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Code Quality

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
rector:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: xdebug

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v5
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Rector Cache
uses: actions/cache@v4
with:
path: /tmp/rector
key: ${{ runner.os }}-rector-${{ github.run_id }}
restore-keys: ${{ runner.os }}-rector-

- run: mkdir -p /tmp/rector

- name: Rector Dry Run
run: php vendor/bin/rector process --dry-run --config=rector.php

phpstan:
Comment thread Fixed
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v5
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- uses: php-actions/phpstan@v3
with:
php_version: 8.2
Comment thread Fixed
22 changes: 17 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"autoload-dev": {
"psr-4": {
"Test\\AlexisPPLIN\\SendcloudV3\\": "test/"
"Test\\AlexisPPLIN\\SendcloudV3\\": "tests/"
}
},
"authors": [
Expand All @@ -31,17 +31,29 @@
],
"require": {
"php": ">=8.2.0",
"psr/http-message": "^2.0",
"psr/http-factory": "^1.1"
"php-http/discovery": "^1.20",
"psr/http-client-implementation": "^1.0",
"php-http/client-common": "^2.7",
"php-http/httplug": "^2.4"
},
"require-dev": {
"guzzlehttp/psr7": "^2.8",
"phpstan/phpstan": "^2.1",
"rector/rector": "^2.3",
"phpunit/phpunit": "^11.5",
"phpunit/php-code-coverage": "^11.0"
"phpunit/php-code-coverage": "^11.0",
"php-http/mock-client": "^1.6",
"nyholm/psr7": "^1.8",
"symfony/http-client": "^7.4"
},
"scripts": {
"test": "vendor/bin/phpunit"
},
"config": {
"platform": {
"php": "8.2"
},
"allow-plugins": {
"php-http/discovery": false
}
}
}
Loading