-
Notifications
You must be signed in to change notification settings - Fork 265
CI: Fix MongoDB version + Makefile and PHPStan for local/CI dev experience #503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7da0ad3
chore: Update MongoDB service configuration in GitHub Actions workflow
HecFranco c3c4993
chore: Add PHPStan for static analysis and update composer dependencies
HecFranco be50679
feat: Add Makefile for Docker command management
HecFranco 48ea78f
chore: Update project configuration and dependencies
HecFranco c0df212
chore: Update PHP version and adjust dependencies in composer files
HecFranco 467b417
chore: Update MongoDB extension version in composer files
HecFranco 2e26167
chore: Update .gitignore and remove .php-cs-fixer.cache
HecFranco 2193db2
chore: Uncomment .php-cs-fixer.cache entry in .gitignore
HecFranco 342193e
chore: Update .gitignore for improved clarity and consistency
HecFranco 21e279c
docs: Add development setup instructions and Makefile details
HecFranco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,20 @@ | ||
| # Composer dependencies (installed with composer install) | ||
| vendor | ||
| composer.lock | ||
|
|
||
| # PhpStorm IDE configuration and cache | ||
| .idea | ||
|
|
||
| # Test application temporary directory | ||
| Tests/app/tmp/ | ||
|
|
||
| # PHPUnit result cache | ||
| .phpunit.result.cache | ||
|
|
||
| # PHP-CS-Fixer cache | ||
| .php-cs-fixer.cache | ||
|
|
||
| # Generated documentation | ||
| .docs | ||
| .demo | ||
|
|
||
| # Demo or demonstration environment | ||
| .demo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <?php | ||
|
|
||
| $finder = PhpCsFixer\Finder::create() | ||
| ->exclude('bin') | ||
| ->exclude('vendor') | ||
| ->in(__DIR__); | ||
|
|
||
| return (new PhpCsFixer\Config()) | ||
| ->setRules([ | ||
| '@PSR12' => true, | ||
| 'array_syntax' => ['syntax' => 'short'], | ||
| 'binary_operator_spaces' => true, | ||
| 'blank_line_after_opening_tag' => true, | ||
| 'concat_space' => ['spacing' => 'one'], | ||
| 'no_extra_blank_lines' => true, | ||
| 'no_leading_import_slash' => true, | ||
| 'no_trailing_comma_in_singleline' => true, | ||
| 'no_unused_imports' => true, | ||
| 'ordered_imports' => true, | ||
| ]) | ||
| ->setFinder($finder); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM php:8.4-cli-bullseye | ||
| FROM php:8.3-cli-bullseye | ||
|
|
||
| ENV COMPOSER_ALLOW_SUPERUSER=1 | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| .PHONY: up down build test rector cs-fix phpstan ensure-up help cache-clear install update | ||
|
|
||
| DOCKER_RUN = docker compose run --rm lexik_translation | ||
|
|
||
| .DEFAULT_GOAL := help | ||
|
|
||
| help: | ||
| @echo "LexikTranslationBundle - Available commands:" | ||
| @echo "" | ||
| @echo " make up Start services in the background" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix white space please |
||
| @echo " make ensure-up Start services and install dependencies (composer)" | ||
| @echo " make down Stop and remove containers" | ||
| @echo " make build Build Docker images" | ||
| @echo " make test Run test suite (PHPUnit)" | ||
| @echo " make rector Run Rector (refactoring)" | ||
| @echo " make cs-fix Apply PHP-CS-Fixer (code style)" | ||
| @echo " make phpstan Run PHPStan (static analysis)" | ||
| @echo " make cache-clear Clear Composer cache" | ||
| @echo " make install Install dependencies (composer install)" | ||
| @echo " make update Update dependencies (composer update)" | ||
| @echo " make help Show this help" | ||
|
|
||
| up: | ||
| docker compose up -d | ||
|
|
||
| ensure-up: | ||
| docker compose up -d | ||
| $(DOCKER_RUN) composer install --prefer-dist --no-progress | ||
|
|
||
| down: | ||
| docker compose down | ||
|
|
||
| build: | ||
| docker compose build | ||
|
|
||
| test: ensure-up | ||
| $(DOCKER_RUN) composer test | ||
|
|
||
| rector: ensure-up | ||
| $(DOCKER_RUN) vendor/bin/rector process | ||
|
|
||
| cs-fix: ensure-up | ||
| $(DOCKER_RUN) vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php | ||
|
|
||
| phpstan: ensure-up | ||
| $(DOCKER_RUN) vendor/bin/phpstan analyse --memory-limit=512M | ||
|
|
||
| cache-clear: ensure-up | ||
| $(DOCKER_RUN) composer clear-cache | ||
|
|
||
| install: ensure-up | ||
| $(DOCKER_RUN) composer install --prefer-dist --no-progress | ||
|
|
||
| update: ensure-up | ||
| $(DOCKER_RUN) composer update --no-progress | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The one downside I see here is that we will not see deprecation errors when testing/running the code on local. Personally, I'm not affected by this, because I have a separate php 8.5 docker running for it, but still...