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
4 changes: 4 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:

jobs:
checks:
name: Run checks
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3

- name: Build and start containers
run: docker compose up -d --build

- name: Wait for services
run: sleep 5

- name: Composer install
run: docker compose exec app composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader

- name: Run PHPUnit
run: docker compose exec app ./vendor/bin/phpunit --no-progress --colors=never

- name: Run PHPStan
run: docker compose exec app ./vendor/bin/phpstan analyse src tests --level=max --no-progress

- name: Run ECS
run: docker compose exec app ./vendor/bin/ecs --fix

- name: Stop containers
if: always()
run: docker compose down --remove-orphans
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
/vendor/
###< symfony/framework-bundle ###

/.phpunit.cache/
/.phpunit.result.cache
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Executables (local)
DOCKER_COMP = docker-compose
DOCKER_COMP = docker compose

# Docker containers
PHP_CONT = $(DOCKER_COMP) exec app
Expand Down Expand Up @@ -35,6 +35,19 @@ logs: ## Show live logs
bash: ## Connect to the PHP FPM container
@$(PHP_CONT) bash

phpunit:
@$(PHP_CONT) ./vendor/bin/phpunit --no-progress --colors=never

phpstan:
@$(PHP_CONT) ./vendor/bin/phpstan analyse src tests --level=max --no-progress

ecs-fix:
@$(PHP_CONT) ./vendor/bin/ecs --fix

ecs:
@$(PHP_CONT) ./vendor/bin/ecs


## —— Composer 🧙 ——————————————————————————————————————————————————————————————
composer: ## Run composer, pass the parameter "c=" to run a given command, example: make composer c='req symfony/orm-pack'
@$(eval c ?=)
Expand Down
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"symfony/yaml": "8.0.*"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.0",
"symplify/easy-coding-standard": "^13.0"
},
"config": {
"allow-plugins": {
Expand All @@ -26,7 +29,8 @@
},
"autoload": {
"psr-4": {
"App\\": "src/"
"App\\": "src/",
"Tests\\": "tests/"
}
},
"autoload-dev": {
Expand Down
Loading