Skip to content

Commit

Permalink
Merge pull request #75 from flagbit/feature/akeneo-6
Browse files Browse the repository at this point in the history
Add Akeneo 6 support
  • Loading branch information
elias-knodel authored Oct 28, 2022
2 parents 43c692f + 58de314 commit cf7b988
Show file tree
Hide file tree
Showing 56 changed files with 1,430 additions and 1,186 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: Tests for Quality Assurance

on:
- "push"
- "pull_request"

jobs:
build:
runs-on: "ubuntu-18.04"
backend-tests:
runs-on: "ubuntu-20.04"
strategy:
matrix:
php-versions: ['7.4']
php-versions: [ '8.0' ]

steps:
- uses: "actions/checkout@v2.0.0"
- uses: "actions/checkout@v3"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1.0.3"
uses: "actions/cache@v3"
with:
path: "~/.composer/cache"
key: "composer-${{ matrix.php-version }}-${{ hashFiles('composer.json') }}"
Expand All @@ -22,40 +24,48 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-versions }}"
extensions: "intl, xdebug, imagick, apcu"
extensions: "intl, xdebug, imagick, apcu, mbstring, bcmath, zip, curl, xsl"

- name: "Install PHP dependencies"
run: "composer install --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress"

- name: "Linting"
run: "vendor/bin/phplint ./src"

- name: "Code Sniffer"
run: "vendor/bin/phpcs -d memory_limit=-1 --standard=PSR2 --extensions=php ./src"

- name: "PHPSpec"
run: "vendor/bin/phpspec run"

- name: "Integration tests"
run: "vendor/bin/phpunit"

frontend:
runs-on: "ubuntu-18.04"
frontend-tests:
runs-on: "ubuntu-20.04"
strategy:
matrix:
php-versions: [ '7.4' ]
php-versions: [ '8.0' ]

steps:
- uses: "actions/checkout@v2.0.0"
- uses: "actions/checkout@v3"

- name: "Setup PHP Action"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-versions }}"
extensions: "intl, xdebug, imagick, apcu"
extensions: "intl, xdebug, imagick, apcu, mbstring, bcmath, zip, curl, xsl"

- name: "Install PHP dependencies"
run: "composer install --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress"

- name: "Setup Node with specific version"
uses: actions/setup-node@v3
with:
node-version: 12

- name: "yarn install"
uses: "borales/actions-yarn@v2.0.0"
uses: "borales/actions-yarn@v3.0.0"
with:
cmd: "install"

Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Editor directories and files
.idea
.vscode

# Akeneo
/.phplint-cache
/vendor/
/phpunit.xml
Expand All @@ -10,3 +15,4 @@
/tests/public/js/extensions.json
/.phpunit.result.cache
/node_modules
var
9 changes: 7 additions & 2 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ build:
- libmagickwand-dev
- libmagickcore-dev
php:
version: 7.4
version: "8.0"
pecl_extensions:
- apcu
- imagick
- zip
tests:
before:
- composer install --no-interaction --no-scripts
override:
- command: phpcs-run
use_website_config: false
3 changes: 3 additions & 0 deletions CHANGELOG-6.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 6.0.0

- Add support for Akeneo 6.0.0.
20 changes: 11 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Contributing

Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in
this project you agree to abide by its terms.

## Branch Compatibility

| Branch | Akeneo Compatibility |
| ------------- |:-------------:|
| `master` | `>= 5.0.0` |
| `4.0` | `>= 4.0.0` |
| `3.0` | `>= 3.0.0` |
| `2.X` | `>= 2.0.5 & < 3.0.0` |
| `2.0` | `>= 2.0.0 & < 2.0.5` |
| `1.X` | `>= 1.6.0 & < 2.0.0` |
| Branch | Akeneo Compatibility |
|----------------|:--------------------:|
| master / `6.0` | `>= 6.0.0` |
| `5.0` | `>= 5.0.0` |
| `4.0` | `>= 4.0.0` |
| `3.0` | `>= 3.0.0` |
| `2.X` | `>= 2.0.5 & < 3.0.0` |
| `2.0` | `>= 2.0.0 & < 2.0.5` |
| `1.X` | `>= 1.6.0 & < 2.0.0` |
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<h4 align="center">Adds the new attribute type Table for Akeneo products.</h4>

<p align="center">
<a href="https://travis-ci.org/flagbit/akeneo-table-attribute-bundle">
<img src="https://img.shields.io/travis/flagbit/akeneo-table-attribute-bundle/master.svg?style=flat-square"/>
<a href="https://github.com/flagbit/akeneo-table-attribute-bundle/actions">
<img src="https://github.com/flagbit/akeneo-table-attribute-bundle/actions/workflows/main.yml/badge.svg"/>
</a>
<img src="https://poser.pugx.org/flagbit/table-attribute-bundle/downloads?format=flat-square">
<a href="https://scrutinizer-ci.com/g/Flagbit/akeneo-table-attribute-bundle">
Expand Down Expand Up @@ -42,13 +42,14 @@ Provides a _table_ as attribute type where you can define a set of columns of di

#### Import/Export

The extension supports the standard Akeneo product import/export, so you don't need to create any special import/export profile for table information.
The extension supports the standard Akeneo product import/export, so you don't need to create any special import/export
profile for table information.

All product information related to attributes of type _table_ will be imported/exported as JSON.
All product information related to attributes of type _table_ will be imported/exported as JSON.

## Installation

Simply install the package with the following command:
Simply install the package with the following command:

``` bash
composer require flagbit/table-attribute-bundle
Expand Down Expand Up @@ -124,6 +125,7 @@ php bin/console --env=prod doctrine:migrations:migrate

This extension supports the latest Akeneo PIM CE/EE stable versions:

* 6.0
* 5.0
* 4.0
* 3.2 (LTS)
Expand Down
30 changes: 21 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"name": "flagbit/table-attribute-bundle",
"description": "The Flagbit Table Attribute Bundle for Akeneo PIM gives you the possibility to enrich your product with multi-dimensional data presentation in the form of tables, allowing you maximum flexibility within the PIM.",
"keywords": ["akeneo", "table", "attribute", "pim", "multidimensional"],
"keywords": [
"akeneo",
"table",
"attribute",
"pim",
"multidimensional"
],
"type": "library",
"minimum-stability": "stable",
"license": "MIT",
Expand Down Expand Up @@ -33,16 +39,22 @@
}
},
"require": {
"php": "8.0.*",
"ext-json": "*",
"akeneo/pim-community-dev": "^5.0"
"akeneo/pim-community-dev": "^6.0"
},
"require-dev": {
"phpspec/phpspec": "^6.1",
"phpunit/phpunit": "^8.0",
"squizlabs/php_codesniffer": "^3.5",
"overtrue/phplint": "^1.2",
"symfony/debug-bundle": "^4.4",
"symfony/web-profiler-bundle": "^4.4",
"symfony/web-server-bundle": "^4.4"
"phpspec/phpspec": "^7.2",
"phpunit/phpunit": "^9.0",
"squizlabs/php_codesniffer": "^3.7",
"overtrue/phplint": "^4.3",
"symfony/debug-bundle": "^5.4.0",
"symfony/web-profiler-bundle": "^5.4.0"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"symfony/flex": true
}
}
}
4 changes: 2 additions & 2 deletions jest/integration/formextensions.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Form Extensions', function() {
it('table attribute overrides akeneo-attribute-select-filter', function() {
describe('Form Extensions', function () {
it('table attribute overrides akeneo-attribute-select-filter', function () {
const formExtensions = require('../../tests/public/js/extensions.json');

const expected = {
Expand Down
7 changes: 7 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<ruleset>
<file>./src</file>
<file>./tests</file>
<exclude-pattern>./vendor/*</exclude-pattern>
<rule ref="PSR1" />
</ruleset>
71 changes: 37 additions & 34 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
colors="true"
backupStaticAttributes="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="./vendor/autoload.php">

<testsuites>
<testsuite name="FlagbitTableAttributeBundle_Test">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>

<php>
<env name="KERNEL_CLASS" value="Flagbit\Bundle\TableAttributeBundle\Test\Kernel\TestKernel"/>
<env name="APP_ENV" value="test"/>
<env name="APP_INDEX_HOSTS" value="elasticsearch:9200"/>
<env name="APP_DATABASE_HOST" value="mysql"/>
<env name="APP_DATABASE_PORT" value=""/>
<env name="APP_DATABASE_NAME" value="akeneo_pim"/>
<env name="APP_DATABASE_USER" value="akeneo_pim"/>
<env name="APP_DATABASE_PASSWORD" value="akeneo_pim"/>
<env name="APP_DEFAULT_LOCALE" value="en"/>
</php>

<filter>
<whitelist>
<directory>src</directory>
<exclude>
<directory>src/Resources</directory>
</exclude>
</whitelist>
</filter>

<logging>
<log type="coverage-clover" target="build/clover.xml"/>
<log type="coverage-html" target="build/coverage-html" lowUpperBound="30" highLowerBound="80"/>
<log type="junit" target="build/junit.xml"/>
</logging>
bootstrap="./vendor/autoload.php"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>src</directory>
</include>
<exclude>
<directory>src/Resources</directory>
</exclude>
<report>
<clover outputFile="build/clover.xml"/>
<html outputDirectory="build/coverage-html" lowUpperBound="30" highLowerBound="80"/>
</report>
</coverage>
<testsuites>
<testsuite name="FlagbitTableAttributeBundle_Test">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<php>
<env name="KERNEL_CLASS" value="Flagbit\Bundle\TableAttributeBundle\Test\Kernel\TestKernel"/>
<env name="APP_ENV" value="test"/>
<env name="APP_INDEX_HOSTS" value="elasticsearch:9200"/>
<env name="APP_DATABASE_HOST" value="mysql"/>
<env name="APP_DATABASE_PORT" value=""/>
<env name="APP_DATABASE_NAME" value="akeneo_pim"/>
<env name="APP_DATABASE_USER" value="akeneo_pim"/>
<env name="APP_DATABASE_PASSWORD" value="akeneo_pim"/>
<env name="APP_DEFAULT_LOCALE" value="en"/>
<env name="AKENEO_PIM_URL" value="localhost:8080"/>
<env name="APP_DEBUG" value="0"/>
</php>
<logging>
<junit outputFile="build/junit.xml"/>
</logging>
</phpunit>
45 changes: 45 additions & 0 deletions phpunit.xml.dist.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!-- Pre phpunit 9 Backup -->
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals="false"
backupStaticAttributes="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="./vendor/autoload.php">

<testsuites>
<testsuite name="FlagbitTableAttributeBundle_Test">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>

<php>
<env name="KERNEL_CLASS" value="Flagbit\Bundle\TableAttributeBundle\Test\Kernel\TestKernel"/>
<env name="APP_ENV" value="test"/>
<env name="APP_INDEX_HOSTS" value="elasticsearch:9200"/>
<env name="APP_DATABASE_HOST" value="mysql"/>
<env name="APP_DATABASE_PORT" value=""/>
<env name="APP_DATABASE_NAME" value="akeneo_pim"/>
<env name="APP_DATABASE_USER" value="akeneo_pim"/>
<env name="APP_DATABASE_PASSWORD" value="akeneo_pim"/>
<env name="APP_DEFAULT_LOCALE" value="en"/>
</php>

<filter>
<whitelist>
<directory>src</directory>
<exclude>
<directory>src/Resources</directory>
</exclude>
</whitelist>
</filter>

<logging>
<log type="coverage-clover" target="build/clover.xml"/>
<log type="coverage-html" target="build/coverage-html" lowUpperBound="30" highLowerBound="80"/>
<log type="junit" target="build/junit.xml"/>
</logging>
</phpunit>
Loading

0 comments on commit cf7b988

Please sign in to comment.