Skip to content
Open
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
19 changes: 0 additions & 19 deletions .github/workflows/automatic-rebase.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/on-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Pull Request

on: pull_request

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- run: make start
- run: docker compose run --rm --no-deps php vendor/bin/php-cs-fixer fix --diff --dry-run
container-deprecations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- run: make start
- run: |
OUTPUT=$(docker compose run --rm --no-deps php bin/console debug:container --deprecations)

echo "$OUTPUT"

if [[ "$OUTPUT" == *"[OK]"* ]]; then
exit 0
else
exit 1
fi
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@
###< phpunit/phpunit ###

.env
docker compose.override.yml
compose.override.yml

###> friendsofphp/php-cs-fixer ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###
17 changes: 17 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

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

return new PhpCsFixer\Config()
->setRules([
'@PhpCsFixer:risky' => true,
'@PHP84Migration' => true,
])
->setRiskyAllowed(true)
->setFinder($finder)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setUsingCache(false)
;
46 changes: 23 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
FROM composer:2.5.8 as composer
FROM composer:2 AS composer

##################################

FROM php:8.3.6-fpm-alpine3.19
FROM php:8.4-fpm-alpine

COPY --from=composer /usr/bin/composer /usr/bin/composer

RUN apk add --no-cache \
bash==5.2.21-r0 \
git==2.43.6-r0 \
icu-dev==74.1-r0
WORKDIR /usr/src/app

RUN mkdir -p /usr/src/app \
&& addgroup docker \
&& adduser -S -h /home/docker -u ${USER_ID:-1000} -G docker docker \
RUN addgroup docker \
&& adduser -S -h /home/docker -u 1000 -G docker docker \
&& chown -R docker /home/docker /usr/src/app \
&& apk add --no-cache --virtual=.build-deps \
autoconf==2.71-r2 \
g++==13.2.1_git20231014-r0 \
make==4.4.1-r2 \
&& docker-php-ext-configure intl \
&& docker-php-ext-install -j"$(nproc)" intl pdo_mysql \
&& pecl install apcu \
&& docker-php-ext-enable apcu intl \
$PHPIZE_DEPS \
&& apk add --no-cache \
bash \
git \
icu-dev \
&& docker-php-ext-configure \
intl \
&& docker-php-ext-install -j"$(nproc)" \
intl \
pdo_mysql \
&& pecl install \
apcu \
&& docker-php-ext-enable \
apcu \
intl \
Comment on lines +11 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu ne lock plus la version installée ? Hadolint ne crie pas ? 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ce que j'ai voulu faire c'est de ne pas avoir à repasser sur le projet tous les deux jours, c'est pour ça que c'est pas une version de patch que j'ai donné pour php et que j'ai pas précisé de version pour alpine. On a pas de contrainte de prod (qui nous pousse à préciser les versions de paquets).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est pas faux :) Est-ce qu'on peut prévoir un build hebdomadaire avec la CI pour s'assurer que tout build chaque lundi par exemple ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah il faut rebase chaque branche et chaque commit de chaque module avancé alors... gros boulot. L0 je vais essayer de faire tourner la CI sur chaque commit mais je ne sais pas si on est capable de rebuild chaque semaine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah oui c'est vrai chaque module a sa propre branche, j'avais un peu zappé cette partie

&& apk del .build-deps

WORKDIR /usr/src/app

COPY composer.json /usr/src/app/composer.json
COPY composer.lock /usr/src/app/composer.lock
COPY composer.* /usr/src/app/

RUN composer install --no-scripts

COPY . /usr/src/app
COPY --chown=docker:docker . /usr/src/app

RUN chown -R 1000:1000 /usr/src/app
USER 1000:1000
USER docker
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
UID := $(shell id -u)

.PHONY: start
start: cp-env build install-deps
docker compose up -d
Expand All @@ -12,23 +14,23 @@ build:

.PHONY: install-deps
install-deps:
docker compose run --rm php composer install
docker compose run --rm --user=$(UID) php composer install

.PHONY: database-migrate
database-migrate:
docker compose run --rm php bin/console doctrine:migrations:migrate
docker compose run --rm --user=$(UID) php bin/console doctrine:migrations:migrate

.PHONY: database-create
database-create:
docker compose run --rm php bin/console doctrine:database:create --if-not-exists
docker compose run --rm --user=$(UID) php bin/console doctrine:database:create --if-not-exists

.PHONY: database-drop
database-drop:
docker compose run --rm php bin/console doctrine:database:drop --if-exists --force
docker compose run --rm --user=$(UID) php bin/console doctrine:database:drop --if-exists --force

.PHONY: fixtures-load
fixtures-load:
docker compose run --rm php bin/console doctrine:fixtures:load
docker compose run --rm --user=$(UID) php bin/console doctrine:fixtures:load

.PHONY: reset-db
reset-db: database-drop database-create database-migrate fixtures-load
45 changes: 45 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
services:
php:
platform: linux/x86_64
build:
context: .
dockerfile: Dockerfile
env_file: .env
volumes:
- .:/usr/src/app:rw
restart: unless-stopped

nginx:
platform: linux/x86_64
image: nginx:alpine
ports:
- 80:80
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./public:/usr/src/app/public:ro
restart: unless-stopped

phpmyadmin:
platform: linux/x86_64
image: phpmyadmin
environment:
PMA_ARBITRARY: 1
ports:
- 8080:80
restart: unless-stopped

database:
platform: linux/x86_64
image: mysql:8.4
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_USER: ${MYSQL_USER}
volumes:
- db_data:/var/lib/mysql:rw
restart: unless-stopped

volumes:
db_data: ~
92 changes: 47 additions & 45 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,53 @@
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.3.6",
"php": "*",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "1.11.99.5",
"doctrine/doctrine-bundle": "^2.13.2",
"doctrine/doctrine-migrations-bundle": "^3.4.1",
"doctrine/orm": "^3.3.2",
"phpdocumentor/reflection-docblock": "^5.6.1",
"symfony/asset": "^7.2.0",
"symfony/console": "^7.2.1",
"symfony/dotenv": "^7.2.0",
"symfony/expression-language": "^7.2.0",
"symfony/flex": "^2.5.0",
"symfony/form": "^7.2.4",
"symfony/framework-bundle": "^7.2.4",
"symfony/http-client": "^7.2.4",
"symfony/intl": "^7.2.0",
"symfony/mailer": "^7.2.3",
"symfony/mime": "^7.0",
"symfony/monolog-bundle": "^3.10.0",
"symfony/notifier": "^7.2.0",
"symfony/process": "^7.2.4",
"symfony/property-access": "^7.2.3",
"symfony/property-info": "^7.2.3",
"symfony/proxy-manager-bridge": "^6.4.13",
"symfony/runtime": "^7.2.3",
"symfony/security-bundle": "^7.2.3",
"symfony/serializer": "^7.2.4",
"symfony/string": "^7.2.0",
"symfony/translation": "^7.2.4",
"symfony/twig-bundle": "^7.2.0",
"symfony/validator": "^7.2.4",
"symfony/web-link": "^7.2.0",
"symfony/yaml": "^7.2.3",
"twig/extra-bundle": "^3.20.0",
"twig/twig": "^3.20.0"
"doctrine/doctrine-bundle": "^2.16",
"doctrine/doctrine-migrations-bundle": "^3.4",
"doctrine/orm": "^3.5",
"phpdocumentor/reflection-docblock": "^5.6",
"symfony/asset": "^6.4",
"symfony/console": "^6.4",
"symfony/dotenv": "^6.4",
"symfony/expression-language": "^6.4",
"symfony/flex": "^2.8",
"symfony/form": "^6.4",
"symfony/framework-bundle": "^6.4",
"symfony/http-client": "^6.4",
"symfony/intl": "^6.4",
"symfony/mailer": "^6.4",
"symfony/mime": "^6.4",
"symfony/monolog-bundle": "^3.10",
"symfony/notifier": "^6.4",
"symfony/process": "^6.4",
"symfony/property-access": "^6.4",
"symfony/property-info": "^6.4",
"symfony/proxy-manager-bridge": "^6.4",
"symfony/runtime": "^6.4",
"symfony/security-bundle": "^6.4",
"symfony/serializer": "^6.4",
"symfony/string": "^6.4",
"symfony/translation": "^6.4",
"symfony/twig-bundle": "^6.4",
"symfony/validator": "^6.4",
"symfony/web-link": "^6.4",
"symfony/yaml": "^6.4",
"twig/extra-bundle": "^3.21",
"twig/twig": "^3.21"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^4.0.0",
"phpunit/phpunit": "^12.0.7",
"symfony/browser-kit": "^7.2.4",
"symfony/css-selector": "^7.2.0",
"symfony/debug-bundle": "^7.2.0",
"symfony/maker-bundle": "^1.62.1",
"symfony/phpunit-bridge": "^7.2.0",
"symfony/stopwatch": "^7.2.4",
"symfony/web-profiler-bundle": "^7.2.4"
"doctrine/doctrine-fixtures-bundle": "^4.0",
"friendsofphp/php-cs-fixer": "^3.87",
"phpunit/phpunit": "^12.0",
"symfony/browser-kit": "^6.4",
"symfony/css-selector": "^6.4",
"symfony/debug-bundle": "^6.4",
"symfony/maker-bundle": "^1.62",
"symfony/phpunit-bridge": "^6.4",
"symfony/stopwatch": "^6.4",
"symfony/web-profiler-bundle": "^6.4"
},
"config": {
"allow-plugins": {
Expand All @@ -75,7 +75,9 @@
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*"
"symfony/polyfill-php72": "*",
"symfony/polyfill-php83": "*",
"symfony/polyfill-php84": "*"
},
"scripts": {
"auto-scripts": {
Expand All @@ -95,7 +97,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "^7.0"
"require": "^6.4"
}
}
}
Loading