Skip to content

Commit

Permalink
Merge pull request #152 from Power-Components/dev
Browse files Browse the repository at this point in the history
Dev - 1.5
  • Loading branch information
luanfreitasdev authored Nov 27, 2021
2 parents 8232c43 + 6b7c11d commit 114534f
Show file tree
Hide file tree
Showing 57 changed files with 1,290 additions and 409 deletions.
40 changes: 35 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,27 @@ on:
jobs:
build:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: powergridtest
ports:
- 3307:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

postgres:
image: postgres:9.6
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: powergridtest
ports:
- 5433:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

strategy:
matrix:
php: [ 7.4, 8.0 ]
Expand Down Expand Up @@ -50,10 +71,19 @@ jobs:
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Cs Fixer
run: vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no --stop-on-violation
run: ./vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no --stop-on-violation

- name: Larastan
run: vendor/bin/phpstan analyse --ansi --memory-limit=-1
- name: Testing with SQLite
run: |
./vendor/bin/pest --configuration phpunit.sqlite.xml
- name: Pest tests
run: vendor/bin/pest
- name: Testing with MySQL
run: |
./vendor/bin/pest --configuration phpunit.mysql.xml
- name: Testing with PostgreSQL
run: |
./vendor/bin/pest --configuration phpunit.pgsql.xml
- name: Larastan
run: ./vendor/bin/phpstan analyse --ansi --memory-limit=-1
27 changes: 16 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "power-components/livewire-powergrid",
"description": "A Laravel Livewire table component with searching, sorting, checkboxes, pagination and export data.",
"description": "PowerGrid generates Advanced Datatables using Laravel Livewire.",
"homepage": "https://github.com/power-components/livewire-powergrid",
"license": "MIT",
"minimum-stability": "dev",
Expand Down Expand Up @@ -36,22 +36,27 @@
"php": "^7.4.1 | ^8.0 | ^8.1",
"livewire/livewire": "^2.4",
"box/spout": "^3",
"doctrine/dbal": "^3.1",
"friendsofphp/php-cs-fixer": "^3.2"
"doctrine/dbal": "^3.1"
},
"scripts": {
"stan": "phpstan analyse --ansi --memory-limit=-1",
"pest": "php ./vendor/bin/pest --colors=always",
"cs-check": "./vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no --stop-on-violation",
"cs-fixer": "./vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no --stop-on-violation",
"fix": "./vendor/bin/php-cs-fixer fix",
"test": [
"@pest",
"@stan",
"@cs-check"
"test": "@test:sqlite",
"test:sqlite": "./vendor/bin/pest --configuration phpunit.sqlite.xml",
"test:mysql": "./vendor/bin/pest --configuration phpunit.mysql.xml",
"test:pgsql": "./vendor/bin/pest --configuration phpunit.pgsql.xml",
"test:sqlsrv": "./vendor/bin/pest --configuration phpunit.sqlsrv.xml",
"test:types": "./vendor/bin/phpstan analyse --ansi --memory-limit=-1",
"test:dbs": [
"@test:sqlite",
"@test:mysql",
"@test:pgsql",
"@test:sqlsrv"
],
"check": [
"@cs-fixer",
"@test"
"@test",
"@test:types"
]
},
"require-dev": {
Expand Down
54 changes: 54 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: '3'
services:
mysql:
container_name: 'mysql_test'
image: 'mysql/mysql-server:8.0'
ports:
- '3307:3306'
command: '--default-authentication-plugin=mysql_native_password'
environment:
MYSQL_ROOT_PASSWORD: 'password'
MYSQL_ROOT_HOST: "%"
MYSQL_DATABASE: 'powergridtest'
MYSQL_USER: 'powergrid'
MYSQL_PASSWORD: 'password'
MYSQL_ALLOW_EMPTY_PASSWORD: 1
networks:
- sail
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-ppassword" ]
retries: 3
timeout: 5s
pgsql:
container_name: 'pgsql_test'
image: 'postgres:13'
ports:
- '5433:5432'
environment:
PGPASSWORD: 'password'
POSTGRES_DB: 'powergridtest'
POSTGRES_USER: 'postgres'
POSTGRES_PASSWORD: 'password'
networks:
- sail
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "powergridtest", "-U", "postgres" ]
retries: 3
timeout: 5s
sqlsrv:
container_name: 'sqlsrv_test'
image: 'mcr.microsoft.com/mssql/server:2017-latest'
ports:
- '1434:1433'
environment:
ACCEPT_EULA: 'Y'
SA_PASSWORD: 'yourStrong(!)Password'
networks:
- sail
healthcheck:
test: [ "CMD", "/opt/mssql-tools/bin/sqlcmd", "-S", "localhost", "-U", "sa", "-P", "yourStrong(!)Password", "-Q", "select 1" ]
retries: 3
timeout: 5s
networks:
sail:
driver: bridge
22 changes: 22 additions & 0 deletions phpunit.mysql.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="mysql"/>
<server name="DB_HOST" value="127.0.0.1"/>
<server name="DB_PORT" value="3307"/>
<server name="DB_USERNAME" value="root"/>
<server name="DB_PASSWORD" value="password"/>
<server name="DB_DATABASE" value="powergridtest"/>
</php>
</phpunit>
26 changes: 26 additions & 0 deletions phpunit.pgsql.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="pgsql"/>
<server name="DB_HOST" value="127.0.0.1"/>
<server name="DB_PORT" value="5433"/>
<server name="DB_USERNAME" value="postgres"/>
<server name="DB_PASSWORD" value="password"/>
<server name="DB_DATABASE" value="powergridtest"/>
</php>
</phpunit>
26 changes: 26 additions & 0 deletions phpunit.sqlite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="sqlite"/>
<server name="DB_HOST" value="127.0.0.1"/>
<server name="DB_PORT" value="0"/>
<server name="DB_USERNAME" value=""/>
<server name="DB_PASSWORD" value=""/>
<server name="DB_DATABASE" value=":memory:"/>
</php>
</phpunit>
22 changes: 22 additions & 0 deletions phpunit.sqlsrv.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="sqlsrv"/>
<server name="DB_HOST" value="127.0.0.1"/>
<server name="DB_PORT" value="1434"/>
<server name="DB_USERNAME" value="sa"/>
<server name="DB_PASSWORD" value="yourStrong(!)Password"/>
<server name="DB_DATABASE" value="tempdb"/>
</php>
</phpunit>
12 changes: 9 additions & 3 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
colors="true"
>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
Expand All @@ -18,4 +15,13 @@
<directory suffix=".php">./src</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="sqlite"/>
<server name="DB_HOST" value=""/>
<server name="DB_PORT" value="0"/>
<server name="DB_USERNAME" value=""/>
<server name="DB_PASSWORD" value=""/>
<server name="DB_DATABASE" value=":memory:"/>
</php>
</phpunit>
6 changes: 6 additions & 0 deletions resources/lang/ca/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
'contains_not' => 'No té contingut',
'starts_with' => 'Comença per',
'ends_with' => 'Acaba en',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => 'Espereu, si us plau!',
Expand Down
6 changes: 6 additions & 0 deletions resources/lang/de/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
'contains_not' => 'enthält nicht',
'starts_with' => 'beginnt mit',
'ends_with' => 'endet with',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => 'Warten Sie mal!',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/en/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
'contains_not' => 'Does not contain',
'starts_with' => 'Starts with',
'ends_with' => 'Ends with',
'is_empty' => 'Is empty',
'is_not_empty' => 'Is not empty',
'is_null' => 'Is null',
'is_not_null' => 'Is not null',
'is_blank' => 'Is blank',
'is_not_blank' => 'Is not blank',

],
'export' => [
'exporting' => 'Please wait!',
Expand Down
6 changes: 6 additions & 0 deletions resources/lang/es/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
'contains_not' => 'No contiene',
'starts_with' => 'Comienza por',
'ends_with' => 'Termina en',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => '¡Espere por favor!',
Expand Down
6 changes: 6 additions & 0 deletions resources/lang/fa/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
'contains_not' => 'شامل نباشد',
'starts_with' => 'شروع شود با',
'ends_with' => 'خاتمه یابد با',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => 'لطفا صبر کنید!',
Expand Down
10 changes: 10 additions & 0 deletions resources/lang/id/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,15 @@
'contains_not' => 'Tidak terkait',
'starts_with' => 'Dimulai dengan',
'ends_with' => 'Diakhiri dengan',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => 'Please wait!',
'completed' => 'Export completed! Your files are ready for download',
],
];
6 changes: 6 additions & 0 deletions resources/lang/it/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
'contains_not' => 'Non contiene',
'starts_with' => 'Inizia con',
'ends_with' => 'Termina con',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => 'Attendere prego!',
Expand Down
6 changes: 6 additions & 0 deletions resources/lang/ms_MY/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
'contains_not' => 'Tidak mengandungi',
'starts_with' => 'Bermula dengan',
'ends_with' => 'Berakhir dengan',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => 'Sila tunggu!',
Expand Down
6 changes: 6 additions & 0 deletions resources/lang/pt_BR/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
'contains_not' => 'Não contém',
'starts_with' => 'Começa com',
'ends_with' => 'Termina com',
'is_null' => 'É nulo',
'is_not_null' => 'Não é núlo',
'is_blank' => 'Está em branco',
'is_not_blank' => 'Não está em branco',
'is_empty' => 'Não está preenchido',
'is_not_empty' => 'Está preenchido',
],
'export' => [
'exporting' => 'Por favor, aguarde!',
Expand Down
Loading

0 comments on commit 114534f

Please sign in to comment.