From dc004fbf82b0c1b5908d27e86684e8686d181279 Mon Sep 17 00:00:00 2001 From: Andrii Havryliuk Date: Mon, 21 Sep 2026 16:31:39 +0200 Subject: [PATCH] feat: configure pipelines, update deps --- .github/workflows/cs-fixer.yml | 31 +++++++++++++++++++++++ .github/workflows/phpstan.yml | 32 +++++++++++++++++++++++ .github/workflows/phpunit.yml | 46 ++++++++++++++++++++++++++++++++++ composer.json | 12 ++++++++- 4 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cs-fixer.yml create mode 100644 .github/workflows/phpstan.yml create mode 100644 .github/workflows/phpunit.yml diff --git a/.github/workflows/cs-fixer.yml b/.github/workflows/cs-fixer.yml new file mode 100644 index 0000000..906edb8 --- /dev/null +++ b/.github/workflows/cs-fixer.yml @@ -0,0 +1,31 @@ +name: CS-Fixer + +on: + push: + branches: + - main + paths: + - '**.php' + - '.php-cs-fixer.dist.php' + pull_request: + workflow_dispatch: + +jobs: + cs-fixer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + tools: composer:v2 + coverage: none + extensions: gd, intl, mbstring, pdo_mysql, sodium, zip + + - name: Install dependencies + run: composer update --no-ansi --no-interaction --no-progress + + - name: Run PHP-CS-Fixer + run: vendor/bin/php-cs-fixer fix --dry-run --diff diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000..8f27b44 --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,32 @@ +name: PHPStan + +on: + push: + branches: + - main + paths: + - '**.php' + - 'phpstan.neon.dist' + - 'composer.json' + pull_request: + workflow_dispatch: + +jobs: + static-analysis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + tools: composer:v2 + coverage: none + extensions: gd, intl, mbstring, pdo_mysql, sodium, zip + + - name: Install dependencies + run: composer update --no-ansi --no-interaction --no-progress + + - name: Run PHPStan + run: vendor/bin/phpstan analyse --no-progress diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 0000000..51a0fd2 --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,46 @@ +name: PHPUnit + +on: + push: + branches: + - main + paths: + - '**.php' + - 'phpunit.xml.dist' + - 'composer.json' + pull_request: + workflow_dispatch: + +jobs: + unit: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-version: + - '8.2' + - '8.3' + dependencies: + - lowest + - highest + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer:v2 + coverage: none + extensions: gd, intl, mbstring, pdo_mysql, sodium, zip + + - name: Install lowest dependencies with composer + if: matrix.dependencies == 'lowest' + run: composer update --no-ansi --no-interaction --no-progress --prefer-lowest + + - name: Install highest dependencies with composer + if: matrix.dependencies == 'highest' + run: composer update --no-ansi --no-interaction --no-progress + + - name: Run PHPUnit + run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index 6532120..8436b37 100644 --- a/composer.json +++ b/composer.json @@ -17,9 +17,12 @@ "require": { "php": ">=8.2", "shopware/core": "~6.7.12 || ~6.8.0", - "promphp/prometheus_client_php": "^2.14" + "promphp/prometheus_client_php": "^2.15.1" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.95", + "opensearch-project/opensearch-php": "^2.6.0", + "phpstan/phpstan": "^2.2", "phpunit/phpunit": "^11.5", "predis/predis": "^2.3" }, @@ -27,6 +30,13 @@ "ext-redis": "Required when the metric storage uses a phpredis connection (via shopware.redis.connections or storage.dsn)", "predis/predis": "Alternative supported Redis client for the metric storage" }, + "config": { + "allow-plugins": { + "php-http/discovery": false, + "symfony/runtime": false + }, + "sort-packages": true + }, "extra": { "shopware-platform-plugin": "Shopware\\PrometheusExporter\\PrometheusExporterBundle", "label": {