-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Local build: rely only on
docker
(#32)
- Loading branch information
Showing
7 changed files
with
47 additions
and
15 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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/.phpunit.cache/ | ||
/vendor/ | ||
/coverage/ | ||
/.env | ||
/.php-cs-fixer.cache | ||
/.phpunit.result.cache | ||
/composer.lock |
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,13 @@ | ||
FROM php:8.3 | ||
|
||
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ | ||
|
||
RUN install-php-extensions @composer pcov | ||
|
||
ARG USER_ID | ||
ARG GROUP_ID | ||
|
||
RUN groupadd --gid ${GROUP_ID} code \ | ||
&& useradd --create-home --shell /bin/bash --uid ${USER_ID} --gid code code | ||
|
||
USER code |
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,23 +1,30 @@ | ||
CSFIX_PHP_BIN=PHP_CS_FIXER_IGNORE_ENV=1 php8.2 | ||
PHP_BIN=php8.2 -d zend.assertions=1 -d error_reporting=-1 | ||
COMPOSER_BIN=$(shell command -v composer) | ||
DOCKER_PHP_EXEC := docker compose run php | ||
PHP_BIN=php -d zend.assertions=1 | ||
|
||
all: csfix static-analysis test | ||
@echo "Done." | ||
|
||
vendor: composer.json | ||
$(PHP_BIN) $(COMPOSER_BIN) update | ||
$(PHP_BIN) $(COMPOSER_BIN) bump | ||
touch vendor | ||
.env: /etc/passwd /etc/group Makefile | ||
printf "USER_ID=%s\nGROUP_ID=%s\n" `id --user "${USER}"` `id --group "${USER}"` > .env | ||
|
||
vendor: .env docker-compose.yml Dockerfile composer.json | ||
docker compose build --pull | ||
$(DOCKER_PHP_EXEC) composer update | ||
$(DOCKER_PHP_EXEC) composer bump | ||
touch --no-create $@ | ||
|
||
.PHONY: csfix | ||
csfix: vendor | ||
$(CSFIX_PHP_BIN) vendor/bin/php-cs-fixer fix -v | ||
$(DOCKER_PHP_EXEC) vendor/bin/php-cs-fixer fix -v | ||
|
||
.PHONY: static-analysis | ||
static-analysis: vendor | ||
$(PHP_BIN) vendor/bin/phpstan analyse $(PHPSTAN_ARGS) | ||
$(DOCKER_PHP_EXEC) $(PHP_BIN) vendor/bin/phpstan analyse --memory-limit=512M $(PHPSTAN_ARGS) | ||
|
||
.PHONY: test | ||
test: vendor | ||
$(PHP_BIN) vendor/bin/phpunit $(PHPUNIT_ARGS) | ||
$(DOCKER_PHP_EXEC) $(PHP_BIN) vendor/bin/phpunit $(PHPUNIT_ARGS) | ||
|
||
.PHONY: clean | ||
clean: | ||
git clean -dfX |
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 @@ | ||
services: | ||
php: | ||
build: | ||
context: . | ||
args: | ||
USER_ID: ${USER_ID} | ||
GROUP_ID: ${GROUP_ID} | ||
volumes: | ||
- .:${PWD} | ||
working_dir: ${PWD} |
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