Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build improvements for Docker and extension (#156)
- Loading branch information
Showing
8 changed files
with
89 additions
and
48 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
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 |
---|---|---|
|
@@ -17,7 +17,6 @@ composer.lock | |
# PHP CS Fixer | ||
.php_cs.cache | ||
|
||
# Env variables | ||
.env | ||
|
||
# PHPUnit | ||
.phpunit.result.cache | ||
coverage.html |
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,2 +1,6 @@ | ||
Yii2 Queue Extension Change Log | ||
Yii Queue Extension Change Log | ||
=============================== | ||
|
||
## 1.0.0 under development | ||
|
||
- Initial release. |
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,53 +1,32 @@ | ||
COMPOSE_PROJECT_NAME=yii-queue | ||
COMPOSE_FILE=tests/docker-compose.yml | ||
export COMPOSE_PROJECT_NAME=yii-queue | ||
|
||
test: test72 test71 test70 test56 | ||
test72: | ||
docker-compose build php72 | ||
docker-compose run php72 vendor/bin/phpunit | ||
docker-compose down | ||
test71: | ||
docker-compose build php71 | ||
docker-compose run php71 vendor/bin/phpunit | ||
docker-compose down | ||
test70: | ||
docker-compose build php70 | ||
docker-compose run php70 vendor/bin/phpunit | ||
docker-compose down | ||
test56: | ||
docker-compose build php56 | ||
docker-compose run php56 vendor/bin/phpunit | ||
docker-compose down | ||
build: | ||
docker-compose -f tests/docker-compose.yml up -d --build | ||
|
||
benchmark: benchmark72 benchmark71 benchmark70 benchmark56 | ||
benchmark72: | ||
docker-compose build php72 | ||
docker-compose run php72 tests/yii benchmark/waiting | ||
docker-compose down | ||
benchmark71: | ||
docker-compose build php71 | ||
docker-compose run php71 tests/yii benchmark/waiting | ||
docker-compose down | ||
benchmark70: | ||
docker-compose build php70 | ||
docker-compose run php70 tests/yii benchmark/waiting | ||
docker-compose down | ||
benchmark56: | ||
docker-compose build php56 | ||
docker-compose run php56 tests/yii benchmark/waiting | ||
docker-compose down | ||
down: | ||
docker-compose -f tests/docker-compose.yml down | ||
|
||
check-cs: | ||
docker-compose build php72 | ||
docker-compose run php72 php-cs-fixer fix --diff --dry-run | ||
docker-compose down | ||
test: | ||
docker-compose -f tests/docker-compose.yml build --pull php$(v) | ||
docker-compose -f tests/docker-compose.yml run php$(v) vendor/bin/phpunit --colors=always -v --debug | ||
make down | ||
|
||
mutation-test: | ||
docker-compose -f tests/docker-compose.yml build --pull php$(v) | ||
docker-compose -f tests/docker-compose.yml run php$(v) php -dpcov.enabled=1 -dpcov.directory=. vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered | ||
make down | ||
|
||
coverage: | ||
docker-compose -f tests/docker-compose.yml run php$(v) vendor/bin/phpunit --coverage-clover coverage.xml | ||
make down | ||
|
||
static-analyze: | ||
docker-compose -f tests/docker-compose.yml run php$(v) vendor/bin/psalm --config=psalm.xml --shepherd --stats --php-version=$(v) | ||
make down | ||
|
||
clean: | ||
docker-compose down | ||
sudo rm -rf tests/runtime/* | ||
sudo rm -f .php_cs.cache | ||
sudo rm -rf composer.lock | ||
sudo rm -rf vendor/ | ||
|
||
clean-all: clean | ||
sudo rm -rf tests/runtime/.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,34 @@ | ||
version: '3.8' | ||
|
||
x-php: &php | ||
volumes: | ||
- ./runtime:/app/tests/runtime | ||
- ..:/app | ||
|
||
services: | ||
php8.0: | ||
<<: *php | ||
container_name: yii-queue-php80 | ||
build: | ||
context: .. | ||
dockerfile: tests/docker/php/Dockerfile | ||
args: | ||
PHP_VERSION: '8.0' | ||
|
||
php8.1: | ||
<<: *php | ||
container_name: yii-queue-php81 | ||
build: | ||
context: .. | ||
dockerfile: tests/docker/php/Dockerfile | ||
args: | ||
PHP_VERSION: '8.1' | ||
|
||
php8.2: | ||
<<: *php | ||
container_name: yii-queue-php82 | ||
build: | ||
context: .. | ||
dockerfile: tests/docker/php/Dockerfile | ||
args: | ||
PHP_VERSION: '8.2' |
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,15 @@ | ||
ARG PHP_VERSION | ||
FROM php:${PHP_VERSION}-fpm-alpine | ||
|
||
RUN apk add git autoconf g++ make linux-headers | ||
|
||
RUN docker-php-ext-install pcntl | ||
RUN pecl install xdebug pcov | ||
RUN docker-php-ext-enable xdebug pcov | ||
|
||
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer | ||
ENV COMPOSER_ALLOW_SUPERUSER 1 | ||
|
||
WORKDIR /app | ||
ENTRYPOINT ["sh", "tests/docker/php/entrypoint.sh"] | ||
CMD ["sleep", "infinity"] |
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,9 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
flock tests/runtime/composer-install.lock composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi | ||
|
||
php --version | ||
set -x | ||
exec "$@" |