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
91 changes: 14 additions & 77 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main
- 7.x

jobs:
install-dependencies:
Expand Down Expand Up @@ -106,9 +107,9 @@ jobs:
fail-on-severity: critical
license-check: true

code-analysis-php-stan:
static-code-analysis:
runs-on: ubuntu-latest
name: PHPStan
name: Static code analysis
needs:
- composer-validation

Expand Down Expand Up @@ -136,91 +137,29 @@ jobs:
key: php-vendor-${{ runner.os }}-${{ github.run_id }}
restore-keys: php-vendor-${{ runner.os }}-${{ github.run_id }}

- name: PHPStan (Src)
run: php -d memory_limit=-1 vendor/bin/phpstan analyse --level max src

- name: PHPStan (Tests)
run: php -d memory_limit=-1 vendor/bin/phpstan analyse --level max tests

code-analysis-php-codesniffer:
runs-on: ubuntu-latest
name: PHPCodeSniffer
needs:
- composer-validation

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring, gd, zip

- name: Restore composer.lock from cache
uses: actions/cache@v4
with:
path: composer.lock
key: php-composer-lock-${{ runner.os }}-${{ github.run_id }}
restore-keys: php-composer-lock-${{ runner.os }}-${{ github.run_id }}
- name: PHPLint (Src)
run: php -d memory_limit=-1 vendor/bin/phplint src

- name: Restore vendor directory from cache
uses: actions/cache@v4
with:
path: vendor
key: php-vendor-${{ runner.os }}-${{ github.run_id }}
restore-keys: php-vendor-${{ runner.os }}-${{ github.run_id }}
- name: PHPLint (Tests)
run: php -d memory_limit=-1 vendor/bin/phplint tests

- name: PHP CodeSniffer (Src)
run: php -d memory_limit=-1 vendor/bin/phpcs --standard=PSR12 src

- name: PHP CodeSniffer (Tests)
run: php -d memory_limit=-1 vendor/bin/phpcs --standard=PSR12 tests

code-analysis-phplint:
runs-on: ubuntu-latest
name: PHPLint
needs:
- composer-validation

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring, gd, zip

- name: Restore composer.lock from cache
uses: actions/cache@v4
with:
path: composer.lock
key: php-composer-lock-${{ runner.os }}-${{ github.run_id }}
restore-keys: php-composer-lock-${{ runner.os }}-${{ github.run_id }}

- name: Restore vendor directory from cache
uses: actions/cache@v4
with:
path: vendor
key: php-vendor-${{ runner.os }}-${{ github.run_id }}
restore-keys: php-vendor-${{ runner.os }}-${{ github.run_id }}

- name: PHPLint (Src)
run: php -d memory_limit=-1 vendor/bin/phplint src
- name: PHPStan (Src)
run: php -d memory_limit=-1 vendor/bin/phpstan analyse --level max src

- name: PHPLint (Tests)
run: php -d memory_limit=-1 vendor/bin/phplint tests
- name: PHPStan (Tests)
run: php -d memory_limit=-1 vendor/bin/phpstan analyse --level max tests

tests-phpunit:
runs-on: ubuntu-latest
name: PHPUnit
needs:
- code-analysis-php-stan
- code-analysis-php-codesniffer
- code-analysis-phplint
- static-code-analysis

steps:
- name: Checkout repository
Expand Down Expand Up @@ -253,7 +192,7 @@ jobs:
restore-keys: php-vendor-${{ runner.os }}-${{ github.run_id }}

- name: Run tests
run: php vendor/bin/phpunit --coverage-clover tests/build/logs/clover.xml --coverage-html tests/build/coverage
run: php vendor/bin/phpunit --coverage-clover tests/build/logs/clover.xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
Expand All @@ -265,9 +204,7 @@ jobs:
runs-on: ubuntu-latest
name: Infection
needs:
- code-analysis-php-stan
- code-analysis-php-codesniffer
- code-analysis-phplint
- static-code-analysis

steps:
- name: Checkout repository
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
/tests/build/
.phpunit.result.cache
/.phplint.cache/
composer.lock
Loading
Loading