-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from intaro/php81
Misc
- Loading branch information
Showing
6 changed files
with
56 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ vendor | |
.travis.yml | ||
|
||
.php_cs.cache | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,9 @@ | ||
FROM scratch AS composer_install_requirements | ||
ARG PHP_IMAGE_TAG | ||
FROM php:${PHP_IMAGE_TAG}-cli-alpine | ||
|
||
COPY composer.json / | ||
|
||
FROM scratch AS test_source | ||
|
||
COPY . . | ||
COPY tests/ /tests/ | ||
COPY phpunit.xml.* phpstan*.neon .php_cs.* / | ||
|
||
FROM alpine:3.9 | ||
|
||
ADD https://php.hernandev.com/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub | ||
|
||
RUN apk --update-cache add ca-certificates && \ | ||
echo "https://php.hernandev.com/v3.11/php-7.4" >> /etc/apk/repositories | ||
|
||
# alpine php package does not include default extensions, be explicit | ||
RUN set -eu; \ | ||
apk add --no-cache \ | ||
php \ | ||
php-iconv \ | ||
php-json \ | ||
php-mbstring \ | ||
php-openssl \ | ||
php-phar \ | ||
php-xml \ | ||
php-dom \ | ||
php-pdo \ | ||
php-curl \ | ||
php-session \ | ||
; ln -s /usr/bin/php7 /usr/bin/php | ||
RUN apk add autoconf gcc g++ make | ||
RUN pecl install redis && docker-php-ext-enable redis | ||
|
||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer | ||
# install Symfony Flex globally to speed up download of Composer packages (parallelized prefetching) | ||
RUN set -eux; \ | ||
composer global require "symfony/flex" --prefer-dist --no-progress --no-suggest --classmap-authoritative; | ||
|
||
WORKDIR /opt/test | ||
|
||
COPY --from=composer_install_requirements / . | ||
|
||
RUN php7 /usr/bin/composer install | ||
|
||
COPY --from=test_source / . | ||
|
||
RUN echo "memory_limit=1G" > /etc/php7/conf.d/99-custom.ini | ||
|
||
ENTRYPOINT ["composer"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ifneq (,$(shell (type docker-compose 2>&1 >/dev/null && echo 1) || true)) | ||
PHP=docker-compose run --rm --no-deps php | ||
else | ||
PHP=php | ||
endif | ||
|
||
PHP_CONSOLE_DEPS=vendor | ||
|
||
vendor: composer.json | ||
@$(PHP) composer install -o -n --no-ansi | ||
@touch vendor || true | ||
|
||
phpcs: $(PHP_CONSOLE_DEPS) | ||
@$(PHP) vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --using-cache=no -v | ||
|
||
phpunit: $(PHP_CONSOLE_DEPS) | ||
@$(PHP) vendor/bin/phpunit --color=always | ||
|
||
check: phpcs phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: '3.4' | ||
|
||
services: | ||
php: | ||
build: | ||
context: . | ||
args: | ||
PHP_IMAGE_TAG: ${PHP_IMAGE_TAG:-7.4} | ||
volumes: | ||
- "./:/opt/test" |