forked from yiisoft/cache-redis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(yiisoft#7) Fixed psalm issues and build image
- Loading branch information
Showing
7 changed files
with
48 additions
and
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
build: | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose up -d --build | ||
help: ## Display help information | ||
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | ||
|
||
down: | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose down | ||
build: ## Build an image from a docker-compose file. Params: {{ v=8.1 }}. Default latest PHP 8.1 | ||
PHP_VERSION=$(filter-out $@,$(v)) docker-compose -f tests/docker/docker-compose.yml up -d --build | ||
|
||
start: | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose up -d | ||
down: ## Stop and remove containers, networks | ||
docker-compose -f tests/docker/docker-compose.yml down | ||
|
||
test: test80 test81 | ||
start: ## Start services | ||
docker-compose -f tests/docker/docker-compose.yml up -d | ||
|
||
test80: | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose build --pull php80 | ||
make create-cluster | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose run php80 vendor/bin/phpunit --colors=always | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose down | ||
sh: ## Enter the container with the application | ||
docker exec -it cache-redis-php sh | ||
|
||
test81: | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose build --pull php81 | ||
test: ## Run tests. Params: {{ v=8.1 }}. Default latest PHP 8.1 | ||
PHP_VERSION=$(filter-out $@,$(v)) docker-compose -f tests/docker/docker-compose.yml build --pull cache-redis-php | ||
make create-cluster | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose run php81 vendor/bin/phpunit --colors=always | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose down | ||
PHP_VERSION=$(filter-out $@,$(v)) docker-compose -f tests/docker/docker-compose.yml run cache-redis-php vendor/bin/phpunit --colors=always | ||
docker-compose -f tests/docker/docker-compose.yml down | ||
|
||
create-cluster: | ||
create-cluster: ## Create Redis cluster | ||
docker exec redis1 sh -c "redis-cli -p 6381 -a Password --cluster create 172.20.128.2:6381 172.20.128.3:6382 172.20.128.4:6383 172.20.128.5:6384 172.20.128.6:6385 172.20.128.7:6386 --cluster-replicas 1 --no-auth-warning --cluster-yes" | ||
|
||
connect-cluster: | ||
connect-cluster: ## Connect to Redis cluster | ||
docker exec -it redis1 sh -c "redis-cli -c -p 6381 -a Password --no-auth-warning" | ||
|
||
mutation-test: | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose build --pull php$(v) | ||
mutation-test: ## Run mutation tests. Params: {{ v=8.1 }}. Default latest PHP 8.1 | ||
PHP_VERSION=$(filter-out $@,$(v)) docker-compose -f tests/docker/docker-compose.yml build --pull cache-redis-php | ||
make create-cluster | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose run php$(v) php -dpcov.enabled=1 -dpcov.directory=. vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose down | ||
PHP_VERSION=$(filter-out $@,$(v)) docker-compose -f tests/docker/docker-compose.yml run cache-redis-php php -dpcov.enabled=1 -dpcov.directory=. vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered | ||
make down | ||
|
||
coverage: ## Run code coverage. Params: {{ v=8.1 }}. Default latest PHP 8.1 | ||
PHP_VERSION=$(filter-out $@,$(v)) docker-compose -f tests/docker/docker-compose.yml run cache-redis-php vendor/bin/phpunit --coverage-clover coverage.xml | ||
make down | ||
|
||
coverage: | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose run php80 vendor/bin/phpunit --coverage-clover coverage.xml | ||
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose down | ||
static-analyze: ## Run code static analyze. Params: {{ v=8.1 }}. Default latest PHP 8.1 | ||
PHP_VERSION=$(filter-out $@,$(v)) docker-compose -f tests/docker/docker-compose.yml run cache-redis-php vendor/bin/psalm --config=psalm.xml --shepherd --stats --php-version=$(v) | ||
make down |
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
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 was deleted.
Oops, something went wrong.
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