-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from LordSimal/cake5
Cake5 upgrade
- Loading branch information
Showing
21 changed files
with
180 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,15 +10,15 @@ on: | |
|
||
jobs: | ||
testsuite: | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: ['7.4', '8.0', '8.1'] | ||
php-version: ['8.1', '8.2'] | ||
db-type: [sqlite, mysql, pgsql] | ||
prefer-lowest: [''] | ||
include: | ||
- php-version: '7.2' | ||
- php-version: '8.1' | ||
db-type: 'sqlite' | ||
prefer-lowest: 'prefer-lowest' | ||
|
||
|
@@ -31,7 +31,7 @@ jobs: | |
POSTGRES_PASSWORD: postgres | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Service | ||
if: matrix.db-type == 'mysql' | ||
|
@@ -62,41 +62,44 @@ jobs: | |
if [[ ${{ matrix.db-type }} == 'sqlite' ]]; then export DB_URL='sqlite:///:memory:'; fi | ||
if [[ ${{ matrix.db-type }} == 'mysql' ]]; then export DB_URL='mysql://root:[email protected]/cakephp'; fi | ||
if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then export DB_URL='postgres://postgres:[email protected]/postgres'; fi | ||
if [[ ${{ matrix.php-version }} == '7.4' ]]; then | ||
if [[ ${{ matrix.php-version }} == '8.1' ]]; then | ||
vendor/bin/phpunit --coverage-clover=coverage.xml | ||
else | ||
vendor/bin/phpunit | ||
fi | ||
- name: Code Coverage Report | ||
if: success() && matrix.php-version == '7.4' | ||
if: success() && matrix.php-version == '8.1' | ||
uses: codecov/codecov-action@v3 | ||
|
||
cs-stan: | ||
name: Coding Standard & Static Analysis | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
php-version: '8.1' | ||
extensions: mbstring, intl | ||
coverage: none | ||
tools: cs2pr, vimeo/psalm:4, phpstan:1 | ||
tools: phive, cs2pr | ||
|
||
- name: Composer Install | ||
run: composer install | ||
- name: Composer install | ||
uses: ramsey/composer-install@v2 | ||
|
||
- name: Install PHP tools with phive. | ||
run: "phive install --trust-gpg-keys 'CF1A108D0E7AE720,51C67305FFC2E5C0,12CE0F1D262429A5'" | ||
|
||
- name: Run phpcs | ||
run: vendor/bin/phpcs -q --report=checkstyle --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/ | cs2pr | ||
run: vendor/bin/phpcs --report=checkstyle src/ tests/ | cs2pr | ||
|
||
- name: Run psalm | ||
if: always() | ||
run: psalm --output-format=github | ||
run: tools/psalm --output-format=github | ||
|
||
- name: Run psalm | ||
- name: Run phpstan | ||
if: always() | ||
run: phpstan analyse | ||
run: tools/phpstan analyse --error-format=github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/composer.lock | ||
/phpunit.xml | ||
/vendor/ | ||
.phpunit.result.cache | ||
/.phpunit.cache | ||
/.idea/ | ||
/config/Migrations/schema-dump-default.lock | ||
/tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phive xmlns="https://phar.io/phive"> | ||
<phar name="phpstan" version="1.10.38" installed="1.10.38" location="./tools/phpstan" copy="false"/> | ||
<phar name="psalm" version="5.15.0" installed="5.15.0" location="./tools/psalm" copy="false"/> | ||
</phive> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="CakePHP Sentry"> | ||
<config name="installed_paths" value="../../cakephp/cakephp-codesniffer" /> | ||
|
||
<rule ref="CakePHP" /> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, array\\{Cake\\\\ORM\\\\Table, mixed\\} given\\.$#" | ||
count: 1 | ||
path: src/Middleware/SocialAuthMiddleware.php | ||
|
||
- | ||
message: "#^Method ADmad\\\\SocialAuth\\\\Plugin\\:\\:bootstrap\\(\\) has parameter \\$app with generic interface Cake\\\\Core\\\\PluginApplicationInterface but does not specify its types\\: TSubject$#" | ||
count: 1 | ||
path: src/Plugin.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
includes: | ||
- phpstan-baseline.neon | ||
|
||
parameters: | ||
level: 8 | ||
checkMissingIterableValueType: false | ||
bootstrapFiles: | ||
- tests/bootstrap.php | ||
paths: | ||
- src/ | ||
ignoreErrors: | ||
- | ||
message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, array\\{Cake\\\\ORM\\\\Table, mixed\\} given\\.$#" | ||
count: 1 | ||
path: src/Middleware/SocialAuthMiddleware.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
bootstrap="tests/bootstrap.php" | ||
colors="true" | ||
stopOnFailure="false" | ||
> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
bootstrap="tests/bootstrap.php" | ||
colors="true" | ||
stopOnFailure="false" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" | ||
cacheDirectory=".phpunit.cache"> | ||
|
||
<testsuites> | ||
<testsuite name="social-auth"> | ||
<directory>tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<!-- Setup a listener for fixtures --> | ||
<listeners> | ||
<listener | ||
class="Cake\TestSuite\Fixture\FixtureInjector"> | ||
<arguments> | ||
<object class="Cake\TestSuite\Fixture\FixtureManager"/> | ||
</arguments> | ||
</listener> | ||
</listeners> | ||
<extensions> | ||
<bootstrap class="Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/> | ||
</extensions> | ||
|
||
<filter> | ||
<whitelist> | ||
<source> | ||
<include> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
</include> | ||
</source> | ||
|
||
<php> | ||
<ini name="memory_limit" value="-1"/> | ||
<env name="FIXTURE_SCHEMA_METADATA" value="./tests/schema.php"/> | ||
<!-- Postgres | ||
<env name="DB_URL" value="postgres://root@localhost/cake_test_db"/> | ||
--> | ||
<!-- Mysql | ||
<env name="DB_URL" value="mysql://root@localhost/cake_test_db"/> | ||
--> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.