-
Notifications
You must be signed in to change notification settings - Fork 1
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 #12 from LordSimal/cake5
Fix CI
- Loading branch information
Showing
30 changed files
with
173 additions
and
225 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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
push: | ||
branches: | ||
- master | ||
- cake5 | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
|
@@ -13,11 +14,11 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: [ '8.0' ] | ||
php-version: [ '8.1', '8.2' ] | ||
db-type: [ 'sqlite', 'mysql', 'pgsql' ] | ||
prefer-lowest: [ '' ] | ||
include: | ||
- php-version: '8.0' | ||
- php-version: '8.1' | ||
db-type: 'sqlite' | ||
prefer-lowest: 'prefer-lowest' | ||
|
||
|
@@ -30,7 +31,7 @@ jobs: | |
POSTGRES_PASSWORD: postgres | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Service | ||
if: matrix.db-type == 'mysql' | ||
|
@@ -50,7 +51,7 @@ jobs: | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composercache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
|
@@ -80,52 +81,48 @@ 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?encoding=utf8'; fi | ||
if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then export DB_URL='postgres://postgres:[email protected]/postgres'; fi | ||
if [[ ${{ matrix.php-version }} == '8.0' && ${{ matrix.db-type }} == 'sqlite' ]]; then | ||
vendor/bin/phpunit --coverage-clover=coverage.xml | ||
if [[ ${{ matrix.php-version }} == '8.1' && ${{ matrix.db-type }} == 'sqlite' ]]; then | ||
vendor/bin/phpunit --display-deprecations --display-incomplete --display-skipped --coverage-clover=coverage.xml | ||
else | ||
vendor/bin/phpunit | ||
vendor/bin/phpunit --display-deprecations | ||
fi | ||
- name: Validate prefer-lowest | ||
run: if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then vendor/bin/validate-prefer-lowest -m; fi | ||
|
||
- name: Code Coverage Report | ||
if: success() && matrix.php-version == '8.0' && matrix.db-type == 'sqlite' | ||
uses: codecov/codecov-action@v1 | ||
if: success() && matrix.php-version == '8.1' && matrix.db-type == 'sqlite' | ||
uses: codecov/codecov-action@v3 | ||
|
||
validation: | ||
name: Coding Standard & Static Analysis | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.0' | ||
php-version: '8.1' | ||
extensions: mbstring, intl | ||
coverage: none | ||
tools: phive, cs2pr | ||
|
||
- name: Get composer cache directory | ||
id: composercache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Composer install | ||
uses: ramsey/composer-install@v2 | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composercache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Composer phpstan setup | ||
run: composer stan-setup | ||
- name: Install PHP tools with phive. | ||
run: "phive install --trust-gpg-keys 'CF1A108D0E7AE720,51C67305FFC2E5C0,12CE0F1D262429A5'" | ||
|
||
- name: Run phpstan | ||
run: vendor/bin/phpstan analyse --error-format=github | ||
- name: Run phpcs | ||
if: always() | ||
run: vendor/bin/phpcs --report=checkstyle src/ tests/ | cs2pr | ||
|
||
- name: Run psalm | ||
run: vendor/bin/psalm.phar --output-format=github | ||
if: always() | ||
run: tools/psalm --output-format=github | ||
|
||
- name: Run phpcs | ||
run: composer cs-check | ||
- name: Run phpstan | ||
if: always() | ||
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 |
---|---|---|
|
@@ -9,3 +9,4 @@ | |
/node_modules | ||
webroot/modified | ||
.phpunit.cache/test-results | ||
/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.28" installed="1.10.28" location="./tools/phpstan" copy="false"/> | ||
<phar name="psalm" version="5.14.1" installed="5.14.1" 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
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 |
---|---|---|
@@ -1,20 +1,25 @@ | ||
<?xml version="1.0"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" cacheDirectory=".phpunit.cache"> | ||
<php> | ||
<!-- E_ALL => 32767 --> | ||
<!-- E_ALL & ~E_USER_DEPRECATED => 16383 --> | ||
<ini name="error_reporting" value="16383"/> | ||
</php> | ||
<testsuites> | ||
<testsuite name="assets"> | ||
<directory>tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<!-- Prevent coverage reports from looking in tests, vendors, config folders --> | ||
<coverage/> | ||
<source> | ||
<include> | ||
<directory suffix=".php">src/</directory> | ||
</include> | ||
</source> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
bootstrap="tests/bootstrap.php" | ||
colors="true" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" | ||
cacheDirectory=".phpunit.cache"> | ||
<php> | ||
<!-- E_ALL => 32767 --> | ||
<!-- E_ALL & ~E_USER_DEPRECATED => 16383 --> | ||
<ini name="error_reporting" value="16383"/> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="assets"> | ||
<directory>tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<!-- Prevent coverage reports from looking in tests, vendors, config folders --> | ||
<source> | ||
<include> | ||
<directory suffix=".php">src/</directory> | ||
</include> | ||
</source> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<files psalm-version="4.x-dev@"> | ||
<files psalm-version="5.14.1@b9d355e0829c397b9b3b47d0c0ed042a8a70284d"> | ||
<file src="src/Controller/Admin/AssetsController.php"> | ||
<MissingDependency occurrences="1"> | ||
<code>AppController</code> | ||
</MissingDependency> | ||
<InternalClass> | ||
<code><![CDATA[new CallbackStream(function () use ($asset) { | ||
return $asset->read(); | ||
})]]></code> | ||
</InternalClass> | ||
<TooManyTemplateParams> | ||
<code><![CDATA[$this->paginate($this->Assets)]]></code> | ||
</TooManyTemplateParams> | ||
</file> | ||
<file src="src/Controller/AppController.php"> | ||
<UndefinedClass occurrences="1"> | ||
<code>BaseController</code> | ||
</UndefinedClass> | ||
</file> | ||
<file src="src/Model/Entity/Asset.php"> | ||
<NonInvariantDocblockPropertyType occurrences="1"> | ||
<code>$_accessible</code> | ||
</NonInvariantDocblockPropertyType> | ||
<PossiblyNullReference occurrences="1"> | ||
<code>toDateTimeString</code> | ||
</PossiblyNullReference> | ||
<PropertyTypeCoercion> | ||
<code><![CDATA[$this->fetchTable('Assets.Assets')]]></code> | ||
</PropertyTypeCoercion> | ||
</file> | ||
</files> |
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.