Skip to content

Commit

Permalink
chore: add docker-cs-fixer in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
mRoca committed Oct 15, 2024
1 parent 21b90ee commit 48921ee
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 21 deletions.
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,22 @@ docker-test-php-70: ## Test on PHP 7.0
php-test-env:7.0 \
/bin/bash -c "composer update -no --no-progress --no-suggest && vendor/bin/phpunit tests"

.PHONY: docker-test-php-80
docker-test-php-80: ## Test on PHP 8.0
.PHONY: docker-build-php-80
docker-build-php-80:
docker build -t php-test-env:8.0 php_env/PHP_8.0
docker run -it -v "${PWD}":/usr/src/mangopay2-php-sdk \

.PHONY: docker-test-php-80
docker-test-php-80: docker-build-php-80 ## Test on PHP 8.0
docker run --rm -it -v "${PWD}":/usr/src/mangopay2-php-sdk \
-w /usr/src/mangopay2-php-sdk \
--user $(shell id -u):$(shell id -g) \
php-test-env:8.0 \
/bin/bash -c "composer update -no --no-progress --no-suggest --ignore-platform-reqs && vendor/bin/phpunit tests"

.PHONY: docker-cs-fixer
docker-cs-fixer: docker-build-php-80 ## Run php-cs-fixer on PHP 8.0
docker run --rm -it -v "${PWD}":/usr/src/mangopay2-php-sdk \
-w /usr/src/mangopay2-php-sdk \
--user $(shell id -u):$(shell id -g) \
php-test-env:8.0 \
/bin/bash -c "composer install && vendor/bin/php-cs-fixer fix"
39 changes: 21 additions & 18 deletions php_env/PHP_8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,30 @@ FROM php:8.0.3-cli

# Update and import specific required librairies

RUN apt-get update && apt-get install -y apt-utils
RUN apt-get install -y \
unzip \
libicu-dev \
libonig-dev \
gcc \
wget \
zlib1g-dev \
libzip-dev
RUN apt-get update \
&& apt-get install -y \
apt-utils \
unzip \
libicu-dev \
libonig-dev \
gcc \
wget \
zlib1g-dev \
libzip-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Parametrize PHP

RUN docker-php-ext-install mbstring
RUN docker-php-ext-install intl
RUN docker-php-ext-install zip
RUN docker-php-ext-install pcntl
RUN docker-php-source delete
RUN docker-php-ext-install \
mbstring \
intl \
zip \
pcntl \
&& docker-php-source delete

# Install composer
COPY composer.sh /
RUN chmod +x composer.sh
RUN /composer.sh
RUN mv composer.phar /usr/local/bin/composer
RUN mkdir /.composer && chmod o+rwx /.composer
RUN chmod +x composer.sh \
&& /composer.sh \
&& mv composer.phar /usr/local/bin/composer \
&& mkdir /.composer && chmod o+rwx /.composer

0 comments on commit 48921ee

Please sign in to comment.