Skip to content

Commit

Permalink
Add a docker-compose setup to allow project contributors to quickly…
Browse files Browse the repository at this point in the history
… run the test suite on their local machines. (#762)

* Added a docker-compose setup to allow others to quickly run the test suite on their local machines without needing to install the test stack onto the environment.

* Added the PHPStan static analysis to the  steps.
  • Loading branch information
ArclightHub authored Dec 4, 2023
1 parent 6291e99 commit 9fca1f0
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# docker-compose up -d && docker logs -f scribe_app_1
FROM ubuntu:jammy
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC

# APT
RUN apt-get -qq update && apt-get install -qq \
make \
curl \
php \
php-curl \
php-xml \
php-sqlite3 \
php-bcmath \
php-curl \
php-gd \
php-imagick \
php-intl \
php-mbstring \
php-pdo \
php-zip \
php-soap \
php-pcov \
git \
p7zip-full

# Composer Install
RUN curl -sS https://getcomposer.org/installer | php && \
mv composer.phar /usr/local/bin/composer
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Test steps, install, lint, test.
test: install lint-ci test-ci

# Composer install step
install:
composer install

# Linter step
lint-ci:
composer lint

# Test step
test-ci:
composer test-ci
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Allow devs to run the unit tests in a dockerized environment
# clear && docker-compose up -d && docker logs -f scribe_app_1
version: '3.7'
services:
app:
build:
context: ./
volumes:
- ./:/testing
working_dir: /testing
command: make test

0 comments on commit 9fca1f0

Please sign in to comment.