Skip to content

Ci updates with plugin tests #137

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

Merged
merged 25 commits into from
Jan 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 78 additions & 17 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2']
php-versions: ['8.1', '8.2']

name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
name: Test PHP ${{ matrix.php-versions }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -21,7 +21,6 @@ jobs:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, sqlite3, xml, simplexml, mysqli
tools: composer:v2
coverage: xdebug

- name: Matrix PHP Version
run: |
Expand All @@ -37,33 +36,59 @@ jobs:
cp config/.env.example config/.env
cp config/app_local.example.php config/app_local.php

- name: Test Suite + Static Analysis (PHP 8.0)
if: ${{ matrix.php-versions == '8.0' }}
- name: Test Suite + Static Analysis
if: ${{ matrix.php-versions}}
run: |
composer analyze

- name: Upload coverage results to Coveralls (PHP 8.0)
if: ${{ matrix.php-versions == '8.0' }}
#
# Run coverage report
#
coverage:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.1']

name: Coverage Report
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, sqlite3, xml, simplexml, mysqli
tools: composer:v2
coverage: xdebug

- name: Composer Check
run: composer validate

- name: Install
run: |
composer install --prefer-dist --no-interaction --no-progress
cp config/.env.example config/.env
cp config/app_local.example.php config/app_local.php

- name: Coverage Report
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
export CODECOVERAGE=1 && vendor/bin/phpunit --verbose --coverage-clover=clover.xml
php-coveralls --coverage_clover=clover.xml -v

- name: Test Suite (PHP 8.1)
if: ${{ matrix.php-versions == '8.1' }}
run: |
composer test

#
# CakePHP version compatability
#
compatibility:
cakephp:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['~4.2.0', '~4.3.0', '^4.4']
version: ['^4.4']
name: Test CakePHP ${{ matrix.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -74,9 +99,6 @@ jobs:
php-version: '8.1'
extensions: mbstring, intl, sqlite3, xml, simplexml, mysqli

- name: PHP Version
run: php -v

- name: CakePHP ${{matrix.version}} Compatability
run: |
cp config/.env.example config/.env
Expand All @@ -85,3 +107,42 @@ jobs:
composer require cakephp/cakephp:${{matrix.version}} --no-update
composer install --prefer-dist --no-progress
composer test

#
# Test plugins individually
#
plugins:
runs-on: ubuntu-latest
strategy:
matrix:
plugin: [
'bake',
'core',
'collection-view',
'crud',
'exception-render',
'hal-view',
'json-ld-view',
'jwt-auth'
]
name: Test ${{ matrix.plugin }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, intl, sqlite3, xml, simplexml, mysqli

- name: PHP Version
run: php -v

- name: ${{matrix.plugin}} tests
run: |
cp config/.env.example config/.env
cp plugins/${{matrix.plugin}}/composer.json .
rm -rf composer.lock
composer install
vendor/bin/phpunit plugins/${{matrix.plugin}}
12 changes: 4 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
"MixerApi\\ExceptionRender\\": "plugins/exception-render/src/",
"MixerApi\\HalView\\": "plugins/hal-view/src/",
"MixerApi\\JsonLdView\\": "plugins/json-ld-view/src/",
"MixerApi\\JwtAuth\\": "plugins/jwt-auth/src/",
"MixerApi\\Rest\\": "plugins/rest/src/"
"MixerApi\\JwtAuth\\": "plugins/jwt-auth/src/"
}
},
"autoload-dev": {
Expand All @@ -73,15 +72,12 @@
"MixerApi\\ExceptionRender\\Test\\App\\": "plugins/exception-render/tests/test_app/src/",
"MixerApi\\HalView\\Test\\": "plugins/hal-view/tests/",
"MixerApi\\HalView\\Test\\App\\": "plugins/hal-view/tests/test_app/src/",
"MixerApi\\JwtAuth\\Test\\": "plugins/jwt-auth/tests/",
"MixerApi\\JwtAuth\\Test\\App\\": "plugins/jwt-auth/tests/test_app/src/",
"MixerApi\\JsonLdView\\Test\\": "plugins/json-ld-view/tests/",
"MixerApi\\JsonLdView\\Test\\App\\": "plugins/json-ld-view/tests/test_app/src/",
"MixerApi\\JwtAuth\\Test\\": "plugins/jwt-auth/tests/",
"MixerApi\\JwtAuth\\Test\\App\\": "plugins/jwt-auth/tests/test_app/src/",
"MixerApi\\Test\\": "plugins/mixerapi/tests/",
"MixerApi\\Test\\App\\": "plugins/mixerapi/tests/test_app/src/",
"MixerApi\\Rest\\Test\\": "plugins/rest/tests/",
"MixerApi\\Rest\\Test\\App\\": "plugins/rest/tests/test_app/src/",
"MixerApi\\Rest\\Test\\MyPlugin\\": "plugins/rest/tests/plugins/MyPlugin/"
"MixerApi\\Test\\App\\": "plugins/mixerapi/tests/test_app/src/"
}
},
"scripts": {
Expand Down
20 changes: 19 additions & 1 deletion plugins/bake/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,22 @@
"cakephp/cakephp": "^4.2",
"cakephp/bake": "^2.1"
},
"require-dev": {
"josegonzalez/dotenv": "^3.2",
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
"MixerApi\\Bake\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"MixerApi\\Bake\\": "plugins/bake/src/",
"MixerApi\\Bake\\Test\\": "plugins/bake/tests/",
"MixerApi\\Bake\\Test\\App\\": "plugins/bake/tests/test_app/src/"
}
},
"support": {
"issues": "https://github.com/mixerapi/mixerapi-dev/issues",
"source": "https://github.com/mixerapi/bake"
Expand All @@ -23,5 +34,12 @@
"name": "MixerApi",
"role": "Organization"
}
]
],
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"cakephp/plugin-installer": true,
"phpro/grumphp": true
}
}
}
20 changes: 19 additions & 1 deletion plugins/collection-view/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,22 @@
"cakephp/cakephp": "^4.2",
"adbario/php-dot-notation": "^2.3"
},
"require-dev": {
"josegonzalez/dotenv": "^3.2",
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
"MixerApi\\CollectionView\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"MixerApi\\CollectionView\\": "plugins/collection-view/src/",
"MixerApi\\CollectionView\\Test\\": "plugins/collection-view/tests/",
"MixerApi\\CollectionView\\Test\\App\\": "plugins/collection-view/tests/test_app/src/"
}
},
"support": {
"issues": "https://github.com/mixerapi/mixerapi-dev/issues",
"source": "https://github.com/mixerapi/collection-view"
Expand All @@ -23,5 +34,12 @@
"name": "MixerApi",
"role": "Organization"
}
]
],
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"cakephp/plugin-installer": true,
"phpro/grumphp": true
}
}
}
20 changes: 19 additions & 1 deletion plugins/core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,22 @@
"cakephp/cakephp": "^4.2",
"thecodingmachine/class-explorer": "^1.1"
},
"require-dev": {
"josegonzalez/dotenv": "^3.2",
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
"MixerApi\\Core\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"MixerApi\\Core\\": "plugins/core/src/",
"MixerApi\\Core\\Test\\": "plugins/core/tests/",
"MixerApi\\Core\\Test\\App\\": "plugins/core/tests/test_app/src/"
}
},
"support": {
"issues": "https://github.com/mixerapi/mixerapi-dev/issues",
"source": "https://github.com/mixerapi/core"
Expand All @@ -23,5 +34,12 @@
"name": "MixerApi",
"role": "Organization"
}
]
],
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"cakephp/plugin-installer": true,
"phpro/grumphp": true
}
}
}
19 changes: 19 additions & 0 deletions plugins/crud/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,31 @@
"php": "^8.0",
"cakephp/cakephp": "^4.2"
},
"require-dev": {
"friendsofcake/search": "^6.0",
"josegonzalez/dotenv": "^3.2",
"phpunit/phpunit": "^9.0"
},
"suggest": {
"friendsofcake/search": "Integrates with mixerapi/crud for easy paginatable search filters"
},
"autoload": {
"psr-4": {
"MixerApi\\Crud\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"MixerApi\\Crud\\": "plugins/crud/src/",
"MixerApi\\Crud\\Test\\": "plugins/crud/tests/",
"MixerApi\\Crud\\Test\\App\\": "plugins/crud/tests/test_app/src/"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"cakephp/plugin-installer": true,
"phpro/grumphp": true
}
}
}
20 changes: 18 additions & 2 deletions plugins/exception-render/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@
"cakephp/cakephp": "^4.2"
},
"require-dev": {
"cnizzardini/cakephp-swagger-bake": "^2.1"
"cnizzardini/cakephp-swagger-bake": "^2.1",
"josegonzalez/dotenv": "^3.2",
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
"MixerApi\\ExceptionRender\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"MixerApi\\ExceptionRender\\": "plugins/exception-render/src/",
"MixerApi\\ExceptionRender\\Test\\": "plugins/exception-render/tests/",
"MixerApi\\ExceptionRender\\Test\\App\\": "plugins/exception-render/tests/test_app/src/"
}
},
"support": {
"issues": "https://github.com/mixerapi/mixerapi-dev/issues",
"source": "https://github.com/mixerapi/exception-render"
Expand All @@ -25,5 +34,12 @@
"name": "MixerApi",
"role": "Organization"
}
]
],
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"cakephp/plugin-installer": true,
"phpro/grumphp": true
}
}
}
20 changes: 18 additions & 2 deletions plugins/hal-view/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,22 @@
"cakephp/cakephp": "^4.2",
"mixerapi/core": "^1.0"
},
"require-dev": {
"josegonzalez/dotenv": "^3.2",
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
"MixerApi\\HalView\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"MixerApi\\HalView\\": "plugins/hal-view/src/",
"MixerApi\\HalView\\Test\\": "plugins/hal-view/tests/",
"MixerApi\\HalView\\Test\\App\\": "plugins/hal-view/tests/test_app/src/"
}
},
"support": {
"issues": "https://github.com/mixerapi/mixerapi-dev/issues",
"source": "https://github.com/mixerapi/hal-view"
Expand All @@ -24,6 +35,11 @@
"role": "Organization"
}
],
"prefer-stable": true,
"minimum-stability": "dev"
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"cakephp/plugin-installer": true,
"phpro/grumphp": true
}
}
}
Loading