Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add docker-cs-fixer in Makefile #658

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
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