-
Notifications
You must be signed in to change notification settings - Fork 60
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 #335 from FriendsOfCake/cake-5
Cake 5
- Loading branch information
Showing
48 changed files
with
333 additions
and
459 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 |
---|---|---|
|
@@ -8,94 +8,14 @@ on: | |
branches: | ||
- '*' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
testsuite: | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: ['7.4', '8.0', '8.1'] | ||
db-type: [mysql, pgsql] | ||
prefer-lowest: [''] | ||
include: | ||
- php-version: '7.2' | ||
db-type: 'sqlite' | ||
prefer-lowest: 'prefer-lowest' | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Service | ||
if: matrix.db-type == 'mysql' | ||
run: | | ||
sudo service mysql start | ||
mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp;' | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: mbstring, intl, pdo_${{ matrix.db-type }} | ||
coverage: pcov | ||
|
||
- name: Composer install | ||
run: | | ||
composer --version | ||
if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then | ||
composer update --prefer-lowest --prefer-stable | ||
else | ||
composer install | ||
fi | ||
- name: Run PHPUnit | ||
run: | | ||
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' && ${{ matrix.db-type }} == 'mysql' ]]; then | ||
vendor/bin/phpunit --coverage-clover=coverage.xml | ||
else | ||
vendor/bin/phpunit | ||
fi | ||
- name: Code Coverage Report | ||
if: success() && matrix.php-version == '7.4' && matrix.db-type == 'mysql' | ||
uses: codecov/codecov-action@v2 | ||
uses: cakephp/.github/.github/workflows/[email protected] | ||
secrets: inherit | ||
|
||
cs-stan: | ||
name: Coding Standard & Static Analysis | ||
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
extensions: mbstring, intl | ||
coverage: none | ||
tools: cs2pr | ||
|
||
- name: Composer Install | ||
run: composer stan-setup | ||
|
||
- name: Run phpcs | ||
run: vendor/bin/phpcs --report=checkstyle src/ tests/ | cs2pr | ||
|
||
- name: Run psalm | ||
if: always() | ||
run: vendor/bin/psalm.phar --output-format=github | ||
|
||
- name: Run phpstan | ||
if: always() | ||
run: vendor/bin/phpstan | ||
uses: cakephp/.github/.github/workflows/[email protected] | ||
secrets: inherit |
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ phpunit.xml | |
composer.lock | ||
.idea/ | ||
.phpunit.result.cache | ||
/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.14" installed="1.10.14" location="./tools/phpstan" copy="false"/> | ||
<phar name="psalm" version="5.10.0" installed="5.10.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
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,27 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
bootstrap="tests/bootstrap.php" | ||
colors="true" | ||
> | ||
|
||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
bootstrap="tests/bootstrap.php" | ||
colors="true" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" | ||
> | ||
<testsuites> | ||
<testsuite name="search"> | ||
<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> | ||
<env name="FIXTURE_SCHEMA_METADATA" value="./tests/schema.php"/> | ||
</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
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.