Added testing

This commit is contained in:
2024-04-22 11:56:36 -04:00
parent 99344fda7d
commit 96d0232d78
13 changed files with 287 additions and 4 deletions

22
Dockerfile Normal file
View File

@ -0,0 +1,22 @@
FROM composer:lts as deps
WORKDIR /app
RUN --mount=type=bind,source=./composer.json,target=composer.json \
--mount=type=bind,source=./composer.lock,target=composer.lock \
--mount=type=cache,target=/tmp/cache \
composer install --no-interaction
FROM php:8-cli as base
WORKDIR /app
RUN apt-get update && \
apt-get install -yq --no-install-recommends libsqlite3-dev && \
rm -rf /var/lib/apt/lists/* && \
docker-php-ext-install pdo pdo_sqlite
COPY ./src /app/src
FROM base as dev
COPY ./tests /app/tests
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
COPY --from=deps /app/vendor/ /app/vendor
FROM dev as test
ENTRYPOINT [ "./vendor/bin/phpunit" ]