Skip to content

Commit

Permalink
Merge pull request #24 from spryker-eco/bugfix/cc-33265-akeneo-depend…
Browse files Browse the repository at this point in the history
…ency-update

CC-33265 Run a compatibility check for Akeneo ECO version support
  • Loading branch information
spryker-release-bot authored Apr 2, 2024
2 parents 31766ba + 8c67302 commit 0b1c960
Show file tree
Hide file tree
Showing 18 changed files with 245 additions and 197 deletions.
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text text=auto eol=lf

*.php diff=php

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
Expand All @@ -20,7 +22,6 @@
*.exe binary

# Remove files for archives generated using `git archive`
architecture-baseline.json export-ignore
dependency.json export-ignore
phpstan.json export-ignore
phpstan.neon export-ignore
Expand All @@ -31,3 +32,5 @@ tooling.yml export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.github/ export-ignore
architecture-baseline.json export-ignore
112 changes: 19 additions & 93 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,126 +1,52 @@
name: CI

env:
APPLICATION_ENV: 'development'
APPLICATION_STORE: 'DE'
PROJECT: 'Akeneo PIM'
DATABASE_VERSION: 10.2
DATABASE_HOST: 127.0.0.1
DATABASE_PORT: 3306
DATABASE_NAME: eu-docker
DATABASE_USERNAME: root
DATABASE_PASSWORD: secret
DATABASE_ROOT_PASSWORD: secret
DATABASE_ALLOW_EMPTY_PASSWORD: false
DATABASE_CHARACTER_SET: utf8
DATABASE_COLLATE: utf8_general_ci

on:
pull_request:
push:
branches:
- 'master'
pull_request:
workflow_dispatch:

jobs:
setup:
name: Setup Database MariaDB
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: getong/[email protected]
with:
host port: ${{ env.DATABASE_PORT }}
container port: ${{ env.DATABASE_PORT }}
character set server: ${{ env.DATABASE_CHARACTER_SET }}
collation server: ${{ env.DATABASE_COLLATE }}
mariadb version: ${{ env.DATABASE_VERSION }}
mysql database: ${{ env.DATABASE_NAME }}
mysql root password: ${{ env.DATABASE_ROOT_PASSWORD }}
mysql user: ${{ env.DATABASE_USERNAME }}
mysql password: ${{ env.DATABASE_PASSWORD }}

ci:
name: Akeneo PIM (PHP ${{ matrix.php-versions }})
needs: setup
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
php-versions:
- '7.2'
- '8.2'

services:
mariadb:
image: mariadb:10.2
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: eu-docker
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
validation:
name: Validation
runs-on: ubuntu-latest

steps:
- name: Checkout@v2
uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP ${{ matrix.php-versions }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, bcmath, pdo_mysql
php-version: '8.2'
extensions: mbstring, intl, bcmath
coverage: none

- name: Get composer cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.php-versions }}-composer-
- name: Composer Install
run: composer install --prefer-dist --no-interaction --profile

- name: Composer validate
- name: Run validation
run: composer validate

- name: Composer version
run: composer --version

- name: Composer install
run: composer install --prefer-dist --no-interaction --optimize-autoloader

- name: PHP syntax validation
- name: Syntax check
run: find ./src -path src -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )

lowest:
name: Akeneo PIM Prefer Lowest (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-22.04
name: Prefer Lowest
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
extensions: mbstring, intl, bcmath, pdo_mysql
php-version: '8.1'
extensions: mbstring, intl, bcmath
coverage: none

- name: Composer Install
run: composer install --prefer-dist --no-interaction --profile

- name: Composer Update
run: composer update --prefer-lowest --prefer-dist --no-interaction --profile -vvv

- name: Prefer lowest installation
run: composer require --dev dereuromark/composer-prefer-lowest;

- name: PHP syntax validation
run: find ./src -path src -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )

- name: Prefer lowest validation
run: vendor/bin/validate-prefer-lowest -m
35 changes: 29 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
# IDEs
/.idea
/.project
/nbproject
/.buildpath
/.settings
# IDE
.idea/
.project/
nbproject/
.buildpath/
.settings/
*.sublime-*

# OS
.DS_Store
*.AppleDouble
*.AppleDB
*.AppleDesktop

# grunt stuff
.grunt
.sass-cache
/node_modules/

# tooling
vendor/
composer.lock
.phpunit.result.cache

# built client resources
src/*/Zed/*/Static/Public
src/*/Zed/*/Static/Assets/sprite

# Propel classes
src/*/Zed/*/Persistence/Propel/Base/*
src/*/Zed/*/Persistence/Propel/Map/*

# tests
tests/**/_generated/
tests/_output/*
!tests/_output/.gitkeep
5 changes: 4 additions & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
build:
environment:
php: '7.2'
php: '8.1'

tests:
override:
- true
dependencies:
override:
- composer self-update

nodes:
analysis:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# AkeneoPim Module

[![CI](https://github.com/spryker-eco/akeneo-pim/actions/workflows/ci.yml/badge.svg)](https://github.com/spryker-eco/akeneo-pim/actions/workflows/ci.yml)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/spryker-eco/akeneo-pim/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/spryker-eco/akeneo-pim/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/spryker-eco/akeneo-pim/badges/build.png?b=master)](https://scrutinizer-ci.com/g/spryker-eco/akeneo-pim/build-status/master)

[![CI](https://scrutinizer-ci.com/g/spryker-eco/akeneo-pim/badges/build.png?b=master)](https://scrutinizer-ci.com/g/spryker-eco/akeneo-pim/build-status/master)
[![Latest Stable Version](https://poser.pugx.org/spryker-eco/akeneo-pim/v/stable.svg)](https://packagist.org/packages/spryker-eco/akeneo-pim)
[![License](https://img.shields.io/github/license/spryker-eco/akeneo-pim.svg?b=master)](https://github.com/spryker-eco/akeneo-pim)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg)](https://php.net/)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.1-8892BF.svg)](https://php.net/)

## Installation

Expand Down
18 changes: 13 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
"description": "AkeneoPim module",
"license": "proprietary",
"require": {
"akeneo/api-php-client": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0",
"php": ">=7.2",
"guzzlehttp/guzzle": "^6.0.0 || ^7.0.0",
"akeneo/api-php-client": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0",
"php": ">=8.1",
"php-http/httplug": "^1.0.0 || ^2.0.0",
"php-http/promise": "^1.0.0",
"psr/http-client": "^1.0.0",
"psr/http-message": "^1.0.0 || ^2.0.0",
"spryker/guzzle": "^2.3.0",
"spryker/kernel": "^3.30.0"
},
"require-dev": {
"spryker/code-sniffer": "*"
"phpstan/phpstan": "^1.0.0",
"spryker/code-sniffer": "*",
"spryker/testify": "*"
},
"autoload": {
"psr-4": {
Expand All @@ -26,7 +32,9 @@
"prefer-stable": true,
"scripts": {
"cs-check": "phpcs -p -s --standard=vendor/spryker/code-sniffer/Spryker/ruleset.xml src/ tests/",
"cs-fix": "phpcbf -p --standard=vendor/spryker/code-sniffer/Spryker/ruleset.xml src/ tests/"
"cs-fix": "phpcbf -p --standard=vendor/spryker/code-sniffer/Spryker/ruleset.xml src/ tests/",
"stan": "phpstan analyse -c phpstan.neon -l 8 src/",
"stan-setup": "cp composer.json composer.backup && COMPOSER_MEMORY_LIMIT=-1 composer require --dev phpstan/phpstan:^0.12 && mv composer.backup composer.json"
},
"extra": {
"branch-alias": {
Expand Down
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
parameters:
level: 7
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
- '#Parameter \#1 \$httpClient of method Akeneo\\Pim\\ApiClient\\AkeneoPimClientBuilder::setHttpClient\(\) expects Akeneo\\Pim\\ApiClient\\Client\\ClientInterface, Psr\\Http\\Client\\ClientInterface given\.#'
Loading

0 comments on commit 0b1c960

Please sign in to comment.