-
Notifications
You must be signed in to change notification settings - Fork 0
Update CI workflow, improve PHP version handling, and refactor code for clarity. #20
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
23da8f0
refactor: Update CI workflow, improve PHP version handling, and refac…
gustavofreze 2469232
refactor: Update CI workflow, improve PHP version handling, and refac…
gustavofreze daa5ed2
refactor: Update CI workflow, improve PHP version handling, and refac…
gustavofreze 6b48152
refactor: Update CI workflow, improve PHP version handling, and refac…
gustavofreze ed7a204
refactor: Update CI workflow, improve PHP version handling, and refac…
gustavofreze File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,68 @@ | ||
| ifeq ($(OS),Windows_NT) | ||
| PWD := $(shell cd) | ||
| else | ||
| PWD := $(shell pwd -L) | ||
| endif | ||
|
|
||
| PWD := $(CURDIR) | ||
| ARCH := $(shell uname -m) | ||
| PLATFORM := | ||
|
|
||
| ifeq ($(ARCH),arm64) | ||
| PLATFORM := --platform=linux/amd64 | ||
| endif | ||
|
|
||
| DOCKER_RUN = docker run ${PLATFORM} --rm -it --net=host -v ${PWD}:/app -w /app gustavofreze/php:8.3 | ||
| DOCKER_RUN = docker run ${PLATFORM} --rm -it --net=host -v ${PWD}:/app -w /app gustavofreze/php:8.5-alpine | ||
|
|
||
| .PHONY: configure test test-file test-no-coverage review show-reports clean | ||
| RESET := \033[0m | ||
| GREEN := \033[0;32m | ||
| YELLOW := \033[0;33m | ||
|
|
||
| configure: | ||
| .DEFAULT_GOAL := help | ||
|
|
||
| .PHONY: configure | ||
| configure: ## Configure development environment | ||
| @${DOCKER_RUN} composer update --optimize-autoloader | ||
|
|
||
| test: | ||
| .PHONY: test | ||
| test: ## Run all tests with coverage | ||
| @${DOCKER_RUN} composer tests | ||
|
|
||
| test-file: | ||
| .PHONY: test-file | ||
| test-file: ## Run tests for a specific file (usage: make test-file FILE=path/to/file) | ||
| @${DOCKER_RUN} composer test-file ${FILE} | ||
|
|
||
| test-no-coverage: | ||
| .PHONY: test-no-coverage | ||
| test-no-coverage: ## Run all tests without coverage | ||
| @${DOCKER_RUN} composer tests-no-coverage | ||
|
|
||
| review: | ||
| .PHONY: review | ||
| review: ## Run static code analysis | ||
| @${DOCKER_RUN} composer review | ||
|
|
||
| show-reports: | ||
| .PHONY: show-reports | ||
| show-reports: ## Open static analysis reports (e.g., coverage, lints) in the browser | ||
| @sensible-browser report/coverage/coverage-html/index.html report/coverage/mutation-report.html | ||
|
|
||
| clean: | ||
| .PHONY: clean | ||
| clean: ## Remove dependencies and generated artifacts | ||
| @sudo chown -R ${USER}:${USER} ${PWD} | ||
| @rm -rf report vendor .phpunit.cache *.lock | ||
|
|
||
| .PHONY: help | ||
| help: ## Display this help message | ||
| @echo "Usage: make [target]" | ||
| @echo "" | ||
| @echo "$$(printf '$(GREEN)')Setup$$(printf '$(RESET)')" | ||
| @grep -E '^(configure):.*?## .*$$' $(MAKEFILE_LIST) \ | ||
| | awk 'BEGIN {FS = ":.*? ## "}; {printf "$(YELLOW)%-25s$(RESET) %s\n", $$1, $$2}' | ||
| @echo "" | ||
| @echo "$$(printf '$(GREEN)')Testing$$(printf '$(RESET)')" | ||
| @grep -E '^(test|test-file|test-no-coverage):.*?## .*$$' $(MAKEFILE_LIST) \ | ||
| | awk 'BEGIN {FS = ":.*?## "}; {printf "$(YELLOW)%-25s$(RESET) %s\n", $$1, $$2}' | ||
| @echo "" | ||
| @echo "$$(printf '$(GREEN)')Quality$$(printf '$(RESET)')" | ||
| @grep -E '^(review):.*?## .*$$' $(MAKEFILE_LIST) \ | ||
| | awk 'BEGIN {FS = ":.*?## "}; {printf "$(YELLOW)%-25s$(RESET) %s\n", $$1, $$2}' | ||
| @echo "" | ||
| @echo "$$(printf '$(GREEN)')Reports$$(printf '$(RESET)')" | ||
| @grep -E '^(show-reports):.*?## .*$$' $(MAKEFILE_LIST) \ | ||
| | awk 'BEGIN {FS = ":.*?## "}; {printf "$(YELLOW)%-25s$(RESET) %s\n", $$1, $$2}' | ||
| @echo "" | ||
| @echo "$$(printf '$(GREEN)')Cleanup$$(printf '$(RESET)')" | ||
| @grep -E '^(clean):.*?## .*$$' $(MAKEFILE_LIST) \ | ||
| | awk 'BEGIN {FS = ":.*?## "}; {printf "$(YELLOW)%-25s$(RESET) %s\n", $$1, $$2}' |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.