Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1c1a5fd
Add CI steps to create database.
thisismeonmounteverest Dec 7, 2025
f9e54dd
Create MariaDB and test database as part of the test workflow.
thisismeonmounteverest Dec 7, 2025
c46c4db
Update ci.yml
thisismeonmounteverest Dec 7, 2025
21990da
Update .env.test
thisismeonmounteverest Dec 7, 2025
486f5bc
Update ci.yml
thisismeonmounteverest Dec 7, 2025
c420ce7
Update ci.yml
thisismeonmounteverest Dec 7, 2025
5dd06a0
Install dependencies and run encore to create needed files for integr…
thisismeonmounteverest Dec 8, 2025
c1978ad
Update ci.yml
thisismeonmounteverest Dec 8, 2025
025ab3d
Update ci.yml
thisismeonmounteverest Dec 8, 2025
50a3993
Update ci.yml
thisismeonmounteverest Dec 8, 2025
66c1a98
Updating ci.yml to use
thisismeonmounteverest Dec 8, 2025
72e4049
Updating ci.yml to use
thisismeonmounteverest Dec 8, 2025
848556d
Updating ci.yml to use $GITHUB_OUTPUT
thisismeonmounteverest Dec 8, 2025
4897f08
Updating ci.yml to use $GITHUB_OUTPUT
thisismeonmounteverest Dec 8, 2025
4cbfe06
Updating ci.yml to use $GITHUB_OUTPUT
thisismeonmounteverest Dec 8, 2025
3bef258
Ignore SignupController for infection (mutating integration tests is …
thisismeonmounteverest Dec 8, 2025
ca73816
Enabling infection run.
thisismeonmounteverest Dec 8, 2025
df99181
Update ci.yml
thisismeonmounteverest Dec 8, 2025
c533c66
Update ci.yml
thisismeonmounteverest Dec 8, 2025
739d420
Update infection.json5.dist
thisismeonmounteverest Dec 8, 2025
7003d91
Update ci.yml
thisismeonmounteverest Dec 8, 2025
4d486b0
Bump versions.
Dec 20, 2025
1329d61
Moving docker setup from nginx and php to Frankenphp.
thisismeonmounteverest Dec 24, 2025
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
8 changes: 4 additions & 4 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MANTICORE_HOST="127.0.0.1"
MANTICORE_PORT="9308"
DB_HOST="127.0.0.1"
DB_PORT="3306"
DB_USER="root"
DB_PASS=""
DB_NAME="bewelcome_test"
DATABASE_URL="mysql://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
DB_USER="bewelcome"
DB_PASS="bewelcome"
DB_NAME="bewelcome"
DATABASE_URL="mysql://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
74 changes: 52 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4
Expand All @@ -48,8 +48,8 @@ jobs:
- name: Run phpcpd tests
run: vendor/bin/phpcpd src --exclude=src/Entity --exclude=src/Repository

phpunit:
name: PHPUnit
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -64,7 +64,7 @@ jobs:

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4
Expand All @@ -77,19 +77,38 @@ jobs:
run: composer install --prefer-dist --no-progress --no-suggest --no-interaction --no-scripts

- name: Run phpunit tests
run: bin/phpunit --coverage-text --coverage-xml=build/logs/phpunit/coverage-xml --coverage-clover=build/logs/phpunit/clover.xml --log-junit=build/logs/phpunit/unit.xml --colors=never --order-by=random --exclude-group=integration
run: bin/phpunit --coverage-text --coverage-xml=build/logs/phpunit/coverage-xml --coverage-clover=build/logs/phpunit/clover.xml --log-junit=build/logs/phpunit/junit.xml --colors=never --order-by=random --exclude-group=integration

# - name: Run Infection tests
# run: vendor/bin/infection --coverage=build/logs/phpunit --min-covered-msi=85 --threads=30
- name: Run Infection tests
run: vendor/bin/infection --skip-initial-tests --coverage=build/logs/phpunit --min-covered-msi=80 --threads=30

# - name: Run Integration tests
# run: bin/phpunit --log-junit=build/logs/phpunit/integration.xml --colors=never --order-by=random --group=integration
- name: Install MariaDB
uses: getong/mariadb-action@v1.11
with:
mysql database: 'bewelcome_test'
mysql user: 'bewelcome'
mysql password: 'bewelcome'

# - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2
# if: ${{ always() }}
# with:
# name: infection.log
# path: infection.log
- name: Create test database
run: bin/console test:database:create --env=test

- name: Setup Yarn
uses: threeal/setup-yarn-action@v2.0.0
with:
version: latest
cache: false

- name: Install yarn dependencies and run webpack
run: yarn install --frozen-lock ; yarn encore dev

- name: Run Integration tests
run: bin/phpunit --log-junit=build/logs/phpunit/integration.xml --colors=never --order-by=random --group=integration

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2
if: ${{ always() }}
with:
name: infection.log
path: infection.log

phploc:
name: PHPLoc
Expand All @@ -106,7 +125,7 @@ jobs:

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4
Expand Down Expand Up @@ -137,7 +156,7 @@ jobs:

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4
Expand Down Expand Up @@ -168,7 +187,7 @@ jobs:
#
# - name: Get Composer Cache Directory
# id: composer-cache
# run: echo "::set-output name=dir::$(composer config cache-files-dir)"
# run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
#
# - name: Cache dependencies
# uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4
Expand Down Expand Up @@ -198,7 +217,7 @@ jobs:

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4
Expand Down Expand Up @@ -228,7 +247,7 @@ jobs:

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4
Expand Down Expand Up @@ -258,7 +277,7 @@ jobs:

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4
Expand Down Expand Up @@ -288,7 +307,7 @@ jobs:

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4
Expand Down Expand Up @@ -322,7 +341,7 @@ jobs:

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4
Expand All @@ -341,3 +360,14 @@ jobs:

- name: Run JS security checker
run: yarn audit --groups dependencies











2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Here is a sample: https://gist.github.com/vincentchalamon/d5defad563ed49d9306a4aa57dfd4498
errors.log
rox_local.ini
.php-version
*.cache.ini
.php_cs.cache
.php-cs-fixer.cache
Expand Down Expand Up @@ -59,6 +60,7 @@ allCountries.zip
/public/bundles/
/var/
/vendor/
/config/reference.php
###< symfony/framework-bundle ###
###> symfony/webpack-encore-bundle ###
/node_modules/
Expand Down
1 change: 0 additions & 1 deletion .php-version

This file was deleted.

65 changes: 9 additions & 56 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
ARG PHP_VERSION=8.5
ARG NGINX_VERSION=1.29
ARG FRANKENPHP_VERSION=1.11


# "php" stage
FROM php:${PHP_VERSION}-fpm-alpine AS bewelcome_php
FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION}-alpine AS bewelcome_php

# persistent / runtime deps
RUN apk add --no-cache \
Expand All @@ -25,49 +25,19 @@ RUN apk add --no-cache \
python3 \
;

ARG APCU_VERSION=5.1.24
RUN set -eux; \
apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
freetype-dev \
icu-dev \
libjpeg-turbo-dev \
libpng-dev \
libxslt-dev \
libzip-dev \
zlib-dev \
; \
\
docker-php-ext-configure zip; \
docker-php-ext-configure gd --with-freetype --with-jpeg=/usr/include/ --enable-gd; \
docker-php-ext-install -j$(nproc) \
install-php-extensions \
apcu \
intl \
gd \
mysqli \
pcntl \
pdo_mysql \
xsl \
zip \
exif \
; \
pecl install \
apcu-${APCU_VERSION} \
; \
pecl clear-cache; \
docker-php-ext-enable \
apcu \
exif \
opcache \
; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --no-cache --virtual .phpexts-rundeps $runDeps; \
\
apk del .build-deps
;

# https://github.com/nodejs/docker-node/issues/1126
RUN set -eux; \
Expand All @@ -80,12 +50,6 @@ RUN export PATH="/usr/local/bin:$PATH"
RUN ln -s $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
COPY docker/php/conf.d/bewelcome.prod.ini $PHP_INI_DIR/conf.d/bewelcome.ini

RUN set -eux; \
{ \
echo '[www]'; \
echo 'ping.path = /ping'; \
} | tee /usr/local/etc/php-fpm.d/docker-healthcheck.conf

# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1

Expand Down Expand Up @@ -143,27 +107,16 @@ RUN set -eux; \
VOLUME /srv/bewelcome/var
VOLUME /srv/bewelcome/data

COPY docker/php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck
RUN chmod +x /usr/local/bin/docker-healthcheck
COPY docker/frankenphp/Caddyfile /etc/caddy/Caddyfile

HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"]
HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["frankenphp", "php-cli", "-r", "echo 1;"]

COPY docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint

ENTRYPOINT ["docker-entrypoint"]
CMD ["php-fpm"]


# "nginx" stage
# depends on the "php" stage above
FROM nginx:${NGINX_VERSION}-alpine AS bewelcome_nginx

COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf

WORKDIR /srv/bewelcome/public
CMD ["frankenphp", "run", "--config", "/etc/caddy/Caddyfile"]

COPY --from=bewelcome_php /srv/bewelcome/public ./

# "php" dev stage
# depends on the "php" stage above
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ int-test:
"./bin/phpunit" --log-junit=build/logs/phpunit/junit.xml --colors=never --order-by=random --group=integration

infection: phpunit
"./vendor/bin/infection" --coverage=build/logs/phpunit --min-covered-msi=85 --threads=30
"./vendor/bin/infection" --skip-initial-tests --coverage=build/logs/phpunit --min-covered-msi=80 --threads=30

#behat: encore
# bin/console doctrine:database:create --env=test --if-not-exists
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@
"alexandresalome/mailcatcher": "^1.3",
"behat/behat": "^3.7",
"cmgmyr/phploc": "^8.0",
"dama/doctrine-test-bundle": "8.*",
"doctrine/data-fixtures": "2.*",
"fakerphp/faker": "^v1.14.1",
"dama/doctrine-test-bundle": "^8.0",
"doctrine/data-fixtures": "^2.0",
"fakerphp/faker": "^v1.14",
"friends-of-behat/mink": "^1.8",
"friends-of-behat/mink-browserkit-driver": "^1.4",
"friends-of-behat/mink-extension": "^2.4",
Expand Down
Loading
Loading