diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7b85f0d2..f11b74ec 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,7 +31,7 @@ jobs: working-directory: 'composer-root-version-checker' - name: Check COMPOSER_ROOT_VERSION - run: make check_composer_root_version + run: make composer_root_version_lint composer-json: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index f990586a..d8d214b0 100644 --- a/Makefile +++ b/Makefile @@ -47,16 +47,23 @@ help: #--------------------------------------------------------------------------- .PHONY: check -check: ## Runs all checks -check: composer_root_version_lint cs composer_normalize phpstan test +check: ## Runs all checks +check: composer_root_version_lint cs autoreview test composer_root_version_check -.PHONY: clean -clean: ## Cleans all created artifacts -clean: - git clean --exclude=.idea/ -ffdx +.PHONY: build +build: ## Builds the PHAR +build: + rm $(PHP_SCOPER_PHAR_BIN) || true + $(MAKE) $(PHP_SCOPER_PHAR_BIN) + +.PHONY: fixtures_composer_outdated +fixtures_composer_outdated: ## Reports outdated dependencies +fixtures_composer_outdated: + @find fixtures -name 'composer.json' -type f -depth 2 -exec dirname '{}' \; | xargs -I % sh -c 'printf "Installing dependencies for %;\n" $$(composer install --working-dir=% --ansi)' + @find fixtures -name 'composer.json' -type f -depth 2 -exec dirname '{}' \; | xargs -I % sh -c 'printf "Checking dependencies for %;\n" $$(composer outdated --direct --working-dir=% --ansi)' .PHONY: cs -cs: ## Fixes CS +cs: ## Fixes CS cs: gitignore_sort composer_normalize php_cs_fixer .PHONY: cs_lint @@ -87,21 +94,13 @@ gitignore_sort: phpstan: $(PHPSTAN_BIN) $(PHPSTAN) -.PHONY: build -build: ## Builds the PHAR -build: - rm $(PHP_SCOPER_PHAR_BIN) || true - $(MAKE) $(PHP_SCOPER_PHAR_BIN) - -.PHONY: fixtures_composer_outdated -fixtures_composer_outdated: ## Reports outdated dependencies -fixtures_composer_outdated: - @find fixtures -name 'composer.json' -type f -depth 2 -exec dirname '{}' \; | xargs -I % sh -c 'printf "Installing dependencies for %;\n" $$(composer install --working-dir=% --ansi)' - @find fixtures -name 'composer.json' -type f -depth 2 -exec dirname '{}' \; | xargs -I % sh -c 'printf "Checking dependencies for %;\n" $$(composer outdated --direct --working-dir=% --ansi)' +.PHONY: autoreview +autoreview: ## Runs the AutoReview checks +autoreview: cs_lint phpstan covers_validator .PHONY: test -test: ## Runs all the tests -test: validate_package covers_validator phpunit e2e +test: ## Runs all the tests +test: validate_package phpunit e2e .PHONY: validate_package validate_package: @@ -109,6 +108,7 @@ validate_package: .PHONY: composer_root_version_check composer_root_version_check: ## Runs all checks for the ComposerRootVersion app +composer_root_version_check: cd composer-root-version-checker; $(MAKE) --file Makefile check .PHONY: composer_root_version_lint @@ -135,7 +135,7 @@ phpunit_coverage_infection: $(PHPUNIT_BIN) vendor $(PHPUNIT_COVERAGE_INFECTION) .PHONY: phpunit_coverage_html -phpunit_coverage_html: ## Runs PHPUnit with code coverage with HTML report +phpunit_coverage_html: ## Runs PHPUnit with code coverage with HTML report phpunit_coverage_html: $(PHPUNIT_BIN) vendor $(PHPUNIT_COVERAGE_HTML) @@ -144,17 +144,22 @@ infection: $(COVERAGE_XML) vendor #infection: $(INFECTION_BIN) $(COVERAGE_XML) vendor if [ -d $(COVERAGE_XML) ]; then $(INFECTION); fi +include .makefile/e2e.file +.PHONY: e2e +e2e: ## Runs end-to-end tests +e2e: e2e_004 e2e_005 e2e_011 e2e_013 e2e_014 e2e_015 e2e_016 e2e_017 e2e_018 e2e_019 e2e_020 e2e_024 e2e_025 e2e_027 e2e_028 e2e_029 e2e_030 e2e_031 e2e_032 e2e_033 e2e_034 e2e_035 + .PHONY: blackfire -blackfire: ## Runs Blackfire profiling +blackfire: ## Runs Blackfire profiling blackfire: vendor @echo "By https://blackfire.io" @echo "This might take a while (~2min)" $(BLACKFIRE) run php bin/php-scoper add-prefix --output-dir=build/php-scoper --force --quiet -include .makefile/e2e.file -.PHONY: e2e -e2e: ## Runs end-to-end tests -e2e: e2e_004 e2e_005 e2e_011 e2e_013 e2e_014 e2e_015 e2e_016 e2e_017 e2e_018 e2e_019 e2e_020 e2e_024 e2e_025 e2e_027 e2e_028 e2e_029 e2e_030 e2e_031 e2e_032 e2e_033 e2e_034 e2e_035 +.PHONY: clean +clean: ## Cleans all created artifacts +clean: + git clean --exclude=.idea/ -ffdx # diff --git a/tests/AutoReview/MakefileE2ETest.php b/tests/AutoReview/MakefileE2ETest.php index c5947c5f..0d7c424c 100644 --- a/tests/AutoReview/MakefileE2ETest.php +++ b/tests/AutoReview/MakefileE2ETest.php @@ -46,19 +46,20 @@ protected function getExpectedHelpOutput(): string # Commands #--------------------------------------------------------------------------- - check: Runs all checks - clean: Cleans all created artifacts - update_root_version: Checks the latest GitHub release and update COMPOSER_ROOT_VERSION accordingly - cs: Fixes CS + check: Runs all checks + build: Builds the PHAR + fixtures_composer_outdated: Reports outdated dependencies + cs: Fixes CS cs_lint: Checks CS - phpstan: Runs PHPStan - build: Builds the PHAR - outdated_fixtures: Reports outdated dependencies - test: Runs all the tests - check_composer_root_version: Checks that the COMPOSER_ROOT_VERSION is up to date - phpunit_coverage_html: Runs PHPUnit with code coverage with HTML report - blackfire: Runs Blackfire profiling - e2e: Runs end-to-end tests + autoreview: Runs the AutoReview checks + test: Runs all the tests + composer_root_version_check: Runs all checks for the ComposerRootVersion app + composer_root_version_lint: Checks that the COMPOSER_ROOT_VERSION is up to date + composer_root_version_update: Updates the COMPOSER_ROOT_VERSION + phpunit_coverage_html: Runs PHPUnit with code coverage with HTML report + e2e: Runs end-to-end tests + blackfire: Runs Blackfire profiling + clean: Cleans all created artifacts EOF; }