-
Notifications
You must be signed in to change notification settings - Fork 10
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
39 changed files
with
436 additions
and
261 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 |
---|---|---|
@@ -0,0 +1,171 @@ | ||
name: Build | ||
|
||
on: | ||
push: ~ | ||
pull_request: ~ | ||
release: | ||
types: [created] | ||
schedule: | ||
- | ||
cron: "0 1 * * 6" # Run at 1am every Saturday | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
|
||
name: "PHP ${{ matrix.php }}, MySQL ${{ matrix.mysql }}" | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [7.4, 7.3] | ||
node: [10.x] | ||
mysql: [5.7, 8.0] | ||
|
||
exclude: | ||
- # PHP 7.3 does not support "caching_sha2_password" authentication plugin which is a default one in MySQL 8.0 | ||
php: 7.3 | ||
mysql: 8.0 | ||
|
||
env: | ||
APP_ENV: test | ||
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}" | ||
|
||
steps: | ||
- | ||
uses: actions/checkout@v2 | ||
|
||
- | ||
name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "${{ matrix.php }}" | ||
extensions: intl | ||
tools: symfony | ||
coverage: none | ||
|
||
- | ||
name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "${{ matrix.node }}" | ||
|
||
- | ||
name: Shutdown default MySQL | ||
run: sudo service mysql stop | ||
|
||
- | ||
name: Setup MySQL | ||
uses: mirromutth/[email protected] | ||
with: | ||
mysql version: "${{ matrix.mysql }}" | ||
mysql root password: "root" | ||
|
||
- | ||
name: Output PHP version for Symfony CLI | ||
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version | ||
|
||
- | ||
name: Install certificates | ||
run: symfony server:ca:install | ||
|
||
- | ||
name: Run Chrome Headless | ||
run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 & | ||
|
||
- | ||
name: Run webserver | ||
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon) | ||
|
||
- | ||
name: Get Composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- | ||
name: Cache Composer | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php-${{ matrix.php }}-composer- | ||
- | ||
name: Install PHP dependencies | ||
run: composer install --no-interaction | ||
|
||
- | ||
name: Get Yarn cache directory | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- | ||
name: Cache Yarn | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-${{ matrix.node }}-yarn- | ||
- | ||
name: Install JS dependencies | ||
run: (cd tests/Application && yarn install) | ||
|
||
- | ||
name: Prepare test application database | ||
run: | | ||
(cd tests/Application && bin/console doctrine:database:create -vvv) | ||
(cd tests/Application && bin/console doctrine:schema:create -vvv) | ||
- | ||
name: Prepare test application assets | ||
run: | | ||
(cd tests/Application && bin/console assets:install public -vvv) | ||
(cd tests/Application && yarn build) | ||
- | ||
name: Prepare test application cache | ||
run: (cd tests/Application && bin/console cache:warmup -vvv) | ||
|
||
- | ||
name: Load fixtures in test application | ||
run: (cd tests/Application && bin/console sylius:fixtures:load -n) | ||
|
||
- | ||
name: Validate composer.json | ||
run: composer validate --ansi --strict | ||
|
||
- | ||
name: Validate database schema | ||
run: (cd tests/Application && bin/console doctrine:schema:validate) | ||
|
||
- | ||
name: Run PHPStan | ||
run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/ | ||
|
||
- | ||
name: Run Psalm | ||
run: vendor/bin/psalm | ||
|
||
- | ||
name: Run PHPSpec | ||
run: vendor/bin/phpspec run --ansi -f progress --no-interaction | ||
|
||
- | ||
name: Run PHPUnit | ||
run: vendor/bin/phpunit --colors=always | ||
|
||
- | ||
name: Run Behat | ||
run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun | ||
|
||
- | ||
name: Upload Behat logs | ||
uses: actions/upload-artifact@v2 | ||
if: failure() | ||
with: | ||
name: Behat logs | ||
path: etc/build/ | ||
if-no-files-found: ignore |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -9,9 +9,6 @@ | |
<a href="https://packagist.org/packages/odiseoteam/sylius-report-plugin" title="Version" target="_blank"> | ||
<img src="https://img.shields.io/packagist/v/odiseoteam/sylius-report-plugin.svg" /> | ||
</a> | ||
<a href="http://travis-ci.org/odiseoteam/SyliusReportPlugin" title="Build status" target="_blank"> | ||
<img src="https://img.shields.io/travis/odiseoteam/SyliusReportPlugin/master.svg" /> | ||
</a> | ||
<a href="https://scrutinizer-ci.com/g/odiseoteam/SyliusReportPlugin/" title="Scrutinizer" target="_blank"> | ||
<img src="https://img.shields.io/scrutinizer/g/odiseoteam/SyliusReportPlugin.svg" /> | ||
</a> | ||
|
@@ -23,93 +20,36 @@ | |
|
||
## Description | ||
|
||
This plugin add data reports to the Sylius administration interface. | ||
This plugin adds data reports to the Sylius administration interface. | ||
It's highly inspired on the old [SyliusReportBundle](https://github.com/Sylius/SyliusReportBundle) and | ||
[Report](https://github.com/Sylius/Report) component using it's good architecture. | ||
|
||
Now supporting Sylius 1.4+ and Symfony 4. | ||
[Report](https://github.com/Sylius/Report) component using its good architecture. | ||
|
||
Support Sylius version 1.6+. | ||
|
||
#### Premium features! | ||
Do you want advanced features? Take a look at our [Report Pro Plugin](https://odiseo.com.ar/plugins-and-bundles/premium/sylius-report-pro-plugin), an extended version of this one. | ||
|
||
### Architecture | ||
|
||
Basically you have a **DataFetcherInterface** and **RendererInterface** interfaces. The first one defines how to fetch the **Data** | ||
according on a configuration provided. And the second one uses the **Data** returned by the fetcher and returns a rendered view. | ||
according to a configuration provided. And the second one uses the **Data** returned by the fetcher and returns a rendered view. | ||
|
||
Some DataFetchers and Renderers come with this plugin but you can create your own by implementing their interfaces. | ||
Some DataFetchers and Renderers come with this plugin, but you can create your own by implementing their interfaces. | ||
|
||
<img src="https://github.com/odiseoteam/SyliusReportPlugin/blob/master/screenshot_1.png" alt="Reports admin"> | ||
|
||
## Demo | ||
|
||
You can see this plugin in action in our Sylius Demo application. | ||
|
||
- Frontend: [sylius-demo.odiseo.com.ar](https://sylius-demo.odiseo.com.ar). | ||
- Frontend: [sylius-demo.odiseo.com.ar](https://sylius-demo.odiseo.com.ar). | ||
- Administration: [sylius-demo.odiseo.com.ar/admin](https://sylius-demo.odiseo.com.ar/admin) with `odiseo: odiseo` credentials. | ||
Next, you can enter to the [reports](https://sylius-demo.odiseo.com.ar/admin/reports/) page. | ||
|
||
## Installation | ||
|
||
1. Run `composer require odiseoteam/sylius-report-plugin` | ||
|
||
2. Enable the plugin in bundles.php but add it before SyliusResourceBundle like follows: | ||
|
||
```php | ||
<?php | ||
|
||
return [ | ||
// ... | ||
Odiseo\SyliusReportPlugin\OdiseoSyliusReportPlugin::class => ['all' => true], | ||
Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true], | ||
// ... | ||
]; | ||
``` | ||
|
||
3. Import the plugin configurations | ||
|
||
```yml | ||
imports: | ||
- { resource: "@OdiseoSyliusReportPlugin/Resources/config/config.yml" } | ||
``` | ||
This plugin use [DoctrineExtensions](https://github.com/beberlei/DoctrineExtensions) to create the different DataFetcher's queries. | ||
For example you will need to add the Doctrine DQL functions as follows if you are using Mysql: | ||
```yml | ||
doctrine: | ||
orm: | ||
# ... | ||
dql: | ||
datetime_functions: | ||
date: DoctrineExtensions\Query\Mysql\Date | ||
month: DoctrineExtensions\Query\Mysql\Month | ||
year: DoctrineExtensions\Query\Mysql\Year | ||
numeric_functions: | ||
round: DoctrineExtensions\Query\Mysql\Round | ||
``` | ||
4. Add the admin routes | ||
```yml | ||
odiseo_sylius_report_plugin_admin: | ||
resource: "@OdiseoSyliusReportPlugin/Resources/config/routing/admin.yml" | ||
prefix: /admin | ||
``` | ||
|
||
5. Finish the installation updating the database schema and installing assets | ||
``` | ||
php bin/console doctrine:migrations:diff | ||
php bin/console doctrine:migrations:migrate | ||
php bin/console sylius:theme:assets:install --symlink | ||
``` | ||
## Documentation | ||
|
||
## Test the plugin | ||
- [Installation](doc/installation.md) | ||
- [Tests](doc/tests.md) | ||
|
||
You can follow the instructions to test this plugins in the proper documentation page: [Test the plugin](doc/tests.md). | ||
|
||
## Credits | ||
|
||
This plugin is maintained by <a href="https://odiseo.io">Odiseo</a>. Want us to help you with this plugin or any Sylius project? Contact us on <a href="mailto:[email protected]">[email protected]</a>. |
Oops, something went wrong.