Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 32 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ jobs:
-
name: Run PHPStan
run: docker compose exec -T php vendor/bin/phpstan --memory-limit=256M
-
name: Run Rector
run: docker compose exec -T php vendor/bin/rector --dry-run
-
name: Check OpenAPI
run: docker compose exec -T php bin/console api:openapi:export --yaml | docker run --rm -i -v $(pwd)/redocly.yaml:/spec/redocly.yaml redocly/cli lint /dev/stdin
Expand Down Expand Up @@ -207,34 +210,35 @@ jobs:
recursive: true

# Lint API
-
name: PHP CS Fixer Cache
uses: actions/cache@v4
with:
path: api/.php-cs-fixer.cache
key: ${{ runner.OS }}-phpcsfixer-${{ github.sha }}
restore-keys: |
${{ runner.OS }}-phpcsfixer-
-
name: Get API changed files
id: api-changed-files
uses: tj-actions/changed-files@v46
with:
files: api/**/*.php
-
name: Get Extra Arguments for PHP-CS-Fixer
id: phpcs-intersection
run: |
CHANGED_FILES=$(echo "${{ steps.api-changed-files.outputs.all_changed_and_modified_files }}" | tr ' ' '\n')
if ! echo "${CHANGED_FILES}" | grep -qE "^api\/(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi
echo "PHPCS_EXTRA_ARGS<<EOF" >> $GITHUB_ENV
echo "$EXTRA_ARGS" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
-
name: Lint API
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=api/.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no ${{ env.PHPCS_EXTRA_ARGS }}"
# todo Waiting for PHP CS Fixer to support PHP 8.4
# -
# name: PHP CS Fixer Cache
# uses: actions/cache@v4
# with:
# path: api/.php-cs-fixer.cache
# key: ${{ runner.OS }}-phpcsfixer-${{ github.sha }}
# restore-keys: |
# ${{ runner.OS }}-phpcsfixer-
# -
# name: Get API changed files
# id: api-changed-files
# uses: tj-actions/changed-files@v46
# with:
# files: api/**/*.php
# -
# name: Get Extra Arguments for PHP-CS-Fixer
# id: phpcs-intersection
# run: |
# CHANGED_FILES=$(echo "${{ steps.api-changed-files.outputs.all_changed_and_modified_files }}" | tr ' ' '\n')
# if ! echo "${CHANGED_FILES}" | grep -qE "^api\/(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi
# echo "PHPCS_EXTRA_ARGS<<EOF" >> $GITHUB_ENV
# echo "$EXTRA_ARGS" >> $GITHUB_ENV
# echo "EOF" >> $GITHUB_ENV
# -
# name: Lint API
# uses: docker://oskarstark/php-cs-fixer-ga
# with:
# args: --config=api/.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no ${{ env.PHPCS_EXTRA_ARGS }}"

# Lint PWA
-
Expand Down
4 changes: 2 additions & 2 deletions api/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

$finder = (new PhpCsFixer\Finder())
$finder = new PhpCsFixer\Finder()
->in(__DIR__)
->exclude('var')
;

return (new PhpCsFixer\Config())
return new PhpCsFixer\Config()
->setRiskyAllowed(true)
->setRules([
'@PhpCsFixer' => true,
Expand Down
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


# Versions
FROM dunglas/frankenphp:1-php8.3 AS frankenphp_upstream
FROM dunglas/frankenphp:1-php8.4 AS frankenphp_upstream


# The different stages of this Dockerfile are meant to be built into separate images
Expand Down
77 changes: 39 additions & 38 deletions api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,63 @@
"type": "project",
"license": "MIT",
"require": {
"php": ">=8.3",
"php": ">=8.4",
"ext-ctype": "*",
"ext-iconv": "*",
"api-platform/doctrine-orm": "^4.1.17",
"api-platform/graphql": "^4.1.17",
"api-platform/symfony": "^4.1.17",
"api-platform/doctrine-orm": "^4.1.18",
"api-platform/graphql": "^4.1.18",
"api-platform/symfony": "^4.1.18",
"doctrine/common": "^3.5",
"doctrine/doctrine-bundle": "^2.14",
"doctrine/doctrine-bundle": "^2.15",
"doctrine/doctrine-fixtures-bundle": "^4.1",
"doctrine/doctrine-migrations-bundle": "^3.4.1",
"doctrine/orm": "^3.3.2",
"doctrine/doctrine-migrations-bundle": "^3.4.2",
"doctrine/orm": "^3.5.0",
"doctrine/persistence": "^3.4",
"myclabs/php-enum": "^1.8.5",
"nelmio/cors-bundle": "^2.5",
"runtime/frankenphp-symfony": "^0.2.0",
"seld/jsonlint": "^1.11",
"symfony/asset": "7.2.*",
"symfony/clock": "7.2.*",
"symfony/console": "7.2.*",
"symfony/dotenv": "7.2.*",
"symfony/expression-language": "7.2.*",
"symfony/flex": "^2.5",
"symfony/framework-bundle": "7.2.*",
"symfony/http-client": "7.2.*",
"symfony/asset": "7.3.*",
"symfony/clock": "7.3.*",
"symfony/console": "7.3.*",
"symfony/dotenv": "7.3.*",
"symfony/expression-language": "7.3.*",
"symfony/flex": "^2.7.1",
"symfony/framework-bundle": "7.3.*",
"symfony/http-client": "7.3.*",
"symfony/mercure-bundle": "^0.3.9",
"symfony/monolog-bundle": "^3.10",
"symfony/property-access": "7.2.*",
"symfony/property-info": "7.2.*",
"symfony/runtime": "7.2.*",
"symfony/security-bundle": "7.2.*",
"symfony/serializer": "7.2.*",
"symfony/twig-bundle": "7.2.*",
"symfony/uid": "7.2.*",
"symfony/validator": "7.2.*",
"symfony/yaml": "7.2.*",
"symfony/property-access": "7.3.*",
"symfony/property-info": "7.3.*",
"symfony/runtime": "7.3.*",
"symfony/security-bundle": "7.3.*",
"symfony/serializer": "7.3.*",
"symfony/twig-bundle": "7.3.*",
"symfony/uid": "7.3.*",
"symfony/validator": "7.3.*",
"symfony/yaml": "7.3.*",
"web-token/jwt-bundle": "^4.0.4",
"webonyx/graphql-php": "^15.20",
"zenstruck/foundry": "^2.3.10"
"zenstruck/foundry": "^2.6.0"
},
"require-dev": {
"dama/doctrine-test-bundle": "^8.3",
"justinrainbow/json-schema": "^6.4.1",
"justinrainbow/json-schema": "^6.4.2",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpdoc-parser": "^2.1",
"phpstan/phpstan": "^2.1.11",
"phpstan/phpstan-doctrine": "^2.0.2",
"phpstan/phpstan": "^2.1.17",
"phpstan/phpstan-doctrine": "^2.0.3",
"phpstan/phpstan-phpunit": "^2.0.6",
"phpstan/phpstan-symfony": "^2.0.4",
"phpunit/phpunit": "^12.1.2",
"symfony/browser-kit": "7.2.*",
"symfony/css-selector": "7.2.*",
"symfony/debug-bundle": "7.2.*",
"symfony/maker-bundle": "^1.62.1",
"symfony/stopwatch": "7.2.*",
"symfony/var-dumper": "7.2.*",
"symfony/web-profiler-bundle": "7.2.*"
"phpstan/phpstan-symfony": "^2.0.6",
"phpunit/phpunit": "^12.2.5",
"rector/rector": "^2.1",
"symfony/browser-kit": "7.3.*",
"symfony/css-selector": "7.3.*",
"symfony/debug-bundle": "7.3.*",
"symfony/maker-bundle": "^1.63.0",
"symfony/stopwatch": "7.3.*",
"symfony/var-dumper": "7.3.*",
"symfony/web-profiler-bundle": "7.3.*"
},
"config": {
"optimize-autoloader": true,
Expand Down Expand Up @@ -112,7 +113,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "7.2.*",
"require": "7.3.*",
"docker": false,
"endpoint": [
"https://api.github.com/repos/Spomky-Labs/recipes/contents/index.json?ref=main",
Expand Down
Loading