-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8.next: Cake5 compatiblity #75
Closed
+802
−981
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e565121
fix some tests
arodu b5a6018
add CI tests for php 8.1
arodu ebadf79
fix some cs
arodu c0e9fac
fix some cs
arodu b593407
Merge pull request #66 from arodu/fix-tests
steinkel d4f8da0
fix: replace Zend\Diactoros\Uri imports by Laminas\Diactoros\Uri
louis-iteracode a392591
style: fix codesniffer errors
louis-iteracode 59aaa71
Merge pull request #70 from Petrucheqa/issue/69-fix-zend-diactoros-uri
ajibarra d125334
cake5 upgrade
LordSimal 6d61505
Merge branch '6.next-cake5' into 8.next-cake4
LordSimal 9ff0291
cake5 upgrade
LordSimal caee6dc
fix CI
LordSimal c3fdd65
fix CI
LordSimal 668f018
cleanup
LordSimal e6579f0
more cleanup
LordSimal 18241b4
more cleanup
LordSimal f374e2b
improve CI
LordSimal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -5,15 +5,22 @@ on: | |
push: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
|
||
jobs: | ||
testsuite: | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: ['7.3', '7.4', '8.0'] | ||
db-type: [sqlite, mysql, pgsql] | ||
prefer-lowest: [''] | ||
php-version: ['8.1'] | ||
db-type: [sqlite, pgsql] | ||
include: | ||
- php-version: '8.1' | ||
db-type: 'mariadb' | ||
- php-version: '8.1' | ||
db-type: 'mysql' | ||
|
||
steps: | ||
- name: Setup MySQL latest | ||
|
@@ -24,7 +31,13 @@ jobs: | |
if: matrix.db-type == 'pgsql' | ||
run: docker run --rm --name=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=cakephp -p 5432:5432 -d postgres | ||
|
||
- uses: actions/checkout@v2 | ||
- uses: getong/[email protected] | ||
if: matrix.db-type == 'mariadb' | ||
with: | ||
mysql database: 'cakephp' | ||
mysql root password: 'root' | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
|
@@ -43,80 +56,67 @@ jobs: | |
run: echo "::set-output name=date::$(date +'%Y-%m')" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v1 | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }} | ||
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }} | ||
|
||
- name: Composer install | ||
run: | | ||
if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then | ||
composer update --prefer-lowest --prefer-stable | ||
else | ||
composer update | ||
fi | ||
run: composer update | ||
|
||
|
||
- name: Setup problem matchers for PHPUnit | ||
if: matrix.php-version == '7.4' && matrix.db-type == 'mysql' | ||
if: matrix.php-version == '8.1' && matrix.db-type == 'mysql' | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
||
- name: Wait for MySQL | ||
if: matrix.db-type == 'mysql' || matrix.db-type == 'mariadb' | ||
run: while ! `mysqladmin ping -h 127.0.0.1 --silent`; do printf 'Waiting for MySQL...\n'; sleep 2; done; | ||
|
||
- 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 }} == 'mariadb' ]]; 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 | ||
export CODECOVERAGE=1 && vendor/bin/phpunit --verbose --coverage-clover=coverage.xml | ||
|
||
if [[ ${{ matrix.php-version }} == '8.1' ]]; then | ||
export CODECOVERAGE=1 | ||
vendor/bin/phpunit --verbose --coverage-clover=coverage.xml | ||
else | ||
vendor/bin/phpunit | ||
fi | ||
|
||
- name: Submit code coverage | ||
if: matrix.php-version == '7.4' | ||
if: matrix.php-version == '8.1' | ||
uses: codecov/codecov-action@v1 | ||
|
||
cs-stan: | ||
name: Coding Standard & Static Analysis | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
extensions: mbstring, intl, apcu, memcached, redis | ||
tools: cs2pr | ||
php-version: '8.1' | ||
extensions: mbstring, intl | ||
coverage: none | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Get date part for cache key | ||
id: key-date | ||
run: echo "::set-output name=date::$(date +'%Y-%m')" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }} | ||
tools: cs2pr, vimeo/psalm:5.4, phpstan:1.9 | ||
|
||
- name: composer install | ||
run: composer stan-setup | ||
run: ramsey/composer-install@v2 | ||
|
||
- name: Run PHP CodeSniffer | ||
run: composer cs-check | ||
run: vendor/bin/phpcs --report=checkstyle src/ tests/ | cs2pr | ||
continue-on-error: true | ||
|
||
- name: Run psalm | ||
if: success() || failure() | ||
run: composer psalm | ||
continue-on-error: true | ||
if: always() | ||
run: psalm --output-format=github | ||
|
||
- name: Run phpstan | ||
if: success() || failure() | ||
run: composer stan | ||
continue-on-error: true | ||
if: always() | ||
run: 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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been moved to the
routes()
method of the Plugin class