-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
185 additions
and
390 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 |
---|---|---|
|
@@ -3,8 +3,7 @@ name: CakePHP Plugin CI | |
on: | ||
push: | ||
branches: | ||
- cake4 | ||
- cake3 | ||
- cake5 | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
@@ -13,40 +12,29 @@ on: | |
|
||
jobs: | ||
testsuite: | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
cakephp-version: ['4.5.*'] | ||
php-version: ['7.4', '8.0', '8.1', '8.2'] | ||
cakephp-version: ['5.0.*'] | ||
php-version: ['8.2', '8.3'] | ||
db-type: ['mysql'] | ||
prefer-lowest: [''] | ||
coverage: ['no'] | ||
include: | ||
- cakephp-version: '4.3.*' | ||
php-version: '7.2' | ||
db-type: 'mysql:5.7' | ||
prefer-lowest: 'prefer-lowest' | ||
coverage: 'no' | ||
- cakephp-version: '4.3.*' | ||
- cakephp-version: '5.0.*' | ||
php-version: '8.1' | ||
db-type: 'mysql' | ||
prefer-lowest: '' | ||
coverage: 'no' | ||
|
||
- cakephp-version: '4.4.*' | ||
php-version: '7.4' | ||
db-type: 'mysql:5.7' | ||
db-type: 'mysql:8.0' | ||
prefer-lowest: 'prefer-lowest' | ||
coverage: 'no' | ||
- cakephp-version: '4.4.*' | ||
- cakephp-version: '5.0.*' | ||
php-version: '8.2' | ||
db-type: 'mysql' | ||
prefer-lowest: '' | ||
coverage: 'no' | ||
|
||
- php-version: '8.2' | ||
cakephp-version: '4.5.*' | ||
- php-version: '8.3' | ||
cakephp-version: '5.*' | ||
db-type: 'mysql' | ||
prefer-lowest: '' | ||
coverage: 'coverage' | ||
|
@@ -56,9 +44,9 @@ jobs: | |
if: matrix.db-type == 'mysql' | ||
run: docker run --rm --name=mysqld -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=cakephp_test -p 3306:3306 -d mysql --default-authentication-plugin=mysql_native_password --disable-log-bin | ||
|
||
- name: Setup MySQL 5.7 | ||
if: matrix.db-type == 'mysql:5.7' | ||
run: docker run --rm --name=mysqld -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=cakephp_test -p 3306:3306 -d mysql:5.7 --character-set-server=utf8 --default-authentication-plugin=mysql_native_password --disable-log-bin | ||
- name: Setup MySQL 8.0 | ||
if: matrix.db-type == 'mysql:8.0' | ||
run: docker run --rm --name=mysqld -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=cakephp_test -p 3306:3306 -d mysql:8.0 --default-authentication-plugin=mysql_native_password --disable-log-bin | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
|
@@ -105,18 +93,14 @@ jobs: | |
composer update | ||
fi | ||
- name: Setup problem matchers for PHPUnit | ||
if: matrix.php-version == '7.4' && matrix.db-type == 'mysql' | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
||
- name: Run PHPUnit | ||
env: | ||
REDIS_PORT: ${{ job.services.redis.ports['6379'] }} | ||
MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }} | ||
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_test?encoding=utf8mb4&init[]=SET sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"'; fi | ||
if [[ ${{ matrix.db-type }} == 'mysql:5.7' ]]; then export DB_URL='mysql://root:[email protected]/cakephp_test?encoding=utf8mb4&init[]=SET sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"'; fi | ||
if [[ ${{ matrix.db-type }} == 'mysql:8.0' ]]; then export DB_URL='mysql://root:[email protected]/cakephp_test?encoding=utf8mb4&init[]=SET sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"'; fi | ||
if [[ ${{ matrix.coverage }} == 'coverage' ]]; then | ||
export CODECOVERAGE=1 && vendor/bin/phpunit --stderr --verbose --coverage-clover=coverage.xml | ||
|
@@ -130,7 +114,7 @@ jobs: | |
|
||
cs-stan: | ||
name: Coding Standard & Static Analysis | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -140,7 +124,7 @@ jobs: | |
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
php-version: '8.3' | ||
extensions: mbstring, intl, apcu | ||
coverage: none | ||
|
||
|
@@ -159,7 +143,7 @@ jobs: | |
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }} | ||
|
||
- name: Get CodeSniffer | ||
run: composer require cakephp/cakephp-codesniffer:^4.0 | ||
run: composer require cakephp/cakephp-codesniffer:^5.0 | ||
# | ||
# - name: composer install | ||
# run: composer stan-setup | ||
|
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,32 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
colors="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
bootstrap="./tests/bootstrap.php" | ||
> | ||
<php> | ||
<ini name="memory_limit" value="-1"/> | ||
<ini name="apc.enable_cli" value="1"/> | ||
</php> | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
colors="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
bootstrap="./tests/bootstrap.php" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" | ||
cacheDirectory=".phpunit.cache" | ||
> | ||
<php> | ||
<ini name="memory_limit" value="-1"/> | ||
<ini name="apc.enable_cli" value="1"/> | ||
</php> | ||
|
||
<!-- Add any additional test suites you want to run here --> | ||
<testsuites> | ||
<testsuite name="Elastic/ActivityLogger Test Suite"> | ||
<directory>./tests/TestCase</directory> | ||
</testsuite> | ||
</testsuites> | ||
<!-- Add any additional test suites you want to run here --> | ||
<testsuites> | ||
<testsuite name="Elastic/ActivityLogger Test Suite"> | ||
<directory>./tests/TestCase</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<!-- Load extension for fixtures --> | ||
<extensions> | ||
<extension class="Cake\TestSuite\Fixture\PHPUnitExtension"/> | ||
</extensions> | ||
|
||
<!-- Prevent coverage reports from looking in tests and vendors --> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">./src/</directory> | ||
</include> | ||
</coverage> | ||
<!-- Load extension for fixtures --> | ||
<extensions> | ||
<bootstrap class="Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/> | ||
</extensions> | ||
|
||
<!-- Prevent coverage reports from looking in tests and vendors --> | ||
<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
Oops, something went wrong.