Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
LDA committed Aug 12, 2024
1 parent fe9d18f commit 83c18db
Show file tree
Hide file tree
Showing 10 changed files with 4,468 additions and 29 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: "CI Tests"

on:
push:
pull_request:

jobs:
tests:
name: "PHP ${{ matrix.php }} ${{ matrix.composer-flags != '' && format(' - Composer {0}', matrix.composer-flags) || '' }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
composer-flags:
- '--prefer-stable'
include:
# Lowest Deps
- php: 7.4
composer-flags: '--prefer-stable --prefer-lowest'
services:
db:
# Docker Hub image
image: mariadb:10.11.8
ports:
- 3306:3306
env:
MARIADB_USER: test
MARIADB_PASSWORD: foobar
MARIADB_DATABASE: bookstore

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
with:
fetch-depth: 2

- name: "Cache Composer packages"
uses: "actions/cache@v3"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}-flags-${{ matrix.composer-flags }}"
restore-keys: "php-"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php }}"
tools: "composer:v2,flex"

- name: "Set Composer stability"
run: "composer config minimum-stability dev"

- name: "Install dependencies"
run: "composer update ${{ matrix.composer-flags }} --prefer-dist"

- name: "Validate composer"
run: "composer validate --strict --no-check-lock --no-check-all"

- name: "Build database"
run: |
cp Tests/Fixtures/App/app/config/parameters.yml.dist Tests/Fixtures/App/app/config/parameters.yml
composer install --dev
./Tests/Fixtures/App/app/console propel:database:create
./Tests/Fixtures/App/app/console propel:sql:insert --force
./Tests/Fixtures/App/app/console propel:build
- name: "Run PHPUnit Tests"
run: "vendor/bin/phpunit"

7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ app/config/parameters.yml
Tests/Fixtures/App/src/Spyrit/TestBundle/Model/Base
Tests/Fixtures/App/src/Spyrit/TestBundle/Model/Map

# PHPUnit files
phpunit.xml
.phpunit.cache/
.phpunit.result.cache

# Composer
composer.phar
phpunit.phar
phpunit.phar
5 changes: 1 addition & 4 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
return new TreeBuilder('spyrit_propel_datagrid');
}
Expand Down
5 changes: 1 addition & 4 deletions DependencyInjection/SpyritPropelDatagridExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
*/
class SpyritPropelDatagridExtension extends Extension
{
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$configuration = new Configuration();
$this->processConfiguration($configuration, $configs);
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ Since composer is the simplest and fastest way to install dependencies, the only
- Branch 2.2 integrates new functionnalities like dynamic max-per-page value
- Branch 2.3 implements batch (mass) actions
* Branch 3.0 (unmaintained) is for Propel2 and Symfony3
* Branch 4.0 (maintained) is for Propel2 and Symfony4
* Branch 4.0 (unmaintained) is for Propel2 and Symfony4
* Branch 5.0 (maintained) is for Propel2 and Symfony5
* Branch 6.0 (maintained) is for Propel2 and Symfony6

### Enable the bundle

Expand Down
14 changes: 4 additions & 10 deletions Tests/Fixtures/App/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class AppKernel extends Kernel
{
public function registerBundles()
public function registerBundles(): iterable
{
return [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
Expand All @@ -19,23 +19,17 @@ public function registerBundles()
];
}

public function registerContainerConfiguration(LoaderInterface $loader)
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(__DIR__.'/config/config_test.yml');
}

/**
* @return string
*/
public function getCacheDir()
public function getCacheDir(): string
{
return sys_get_temp_dir().'/SpyritPropelDatagridBundle/cache';
}

/**
* @return string
*/
public function getLogDir()
public function getLogDir(): string
{
return sys_get_temp_dir().'/SpyritPropelDatagridBundle/logs';
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/Fixtures/App/app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ parameters:
database_host: 127.0.0.1
database_port: ~
database_name: bookstore
database_user: travis
database_password: ~
database_user: test
database_password: foobar
database_charset: UTF8
locale: en
secret: dz7am99bonp0tbd215iznv2571bwffq3pri6966710484fy0
Expand Down
12 changes: 7 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@
"email": "[email protected]"
},
"require": {
"php": ">=7.0.0",
"symfony/symfony": "~3.4|~4.0|~5.0",
"php": ">=7.4.0",
"symfony/symfony": "~4.0|~5.0|~6.0",
"symfony/monolog-bundle": "~2.4|~3.0",
"propel/propel": "^2.0@alpha|2.0.x-dev",
"csanquer/colibri-csv": "~1.2"
},
"require-dev": {
"phpunit/phpunit": "~6.0|~7.0",
"propel/propel-bundle": "4.0.x-dev"
"phpunit/phpunit": "^9.6",
"phpunit/php-code-coverage": "^9.2",
"skyfox/propel-bundle": "^5.1|^6.0",
"symfony/phpunit-bridge": "^7.1"
},
"autoload": {
"psr-0": { "Spyrit\\PropelDatagridBundle": "" }
Expand All @@ -43,7 +45,7 @@
"repositories": [
{
"type": "git",
"url": "https://github.com/gharlan/PropelBundle"
"url": "https://github.com/SkyFoxvn/PropelBundle"
}
]
}
Loading

0 comments on commit 83c18db

Please sign in to comment.