Skip to content

Commit b83fded

Browse files
authored
chore(makefile): Re-organise the make commands (#824)
- Change the order of the commands - Introduce a `autoreview` make command - Add `composer_root_version_check` to the `check` command - Make all doc 1 space
1 parent 2ea72b0 commit b83fded

File tree

3 files changed

+45
-39
lines changed

3 files changed

+45
-39
lines changed

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
working-directory: 'composer-root-version-checker'
3232

3333
- name: Check COMPOSER_ROOT_VERSION
34-
run: make check_composer_root_version
34+
run: make composer_root_version_lint
3535

3636
composer-json:
3737
runs-on: ubuntu-latest

Makefile

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,23 @@ help:
4747
#---------------------------------------------------------------------------
4848

4949
.PHONY: check
50-
check: ## Runs all checks
51-
check: composer_root_version_lint cs composer_normalize phpstan test
50+
check: ## Runs all checks
51+
check: composer_root_version_lint cs autoreview test composer_root_version_check
5252

53-
.PHONY: clean
54-
clean: ## Cleans all created artifacts
55-
clean:
56-
git clean --exclude=.idea/ -ffdx
53+
.PHONY: build
54+
build: ## Builds the PHAR
55+
build:
56+
rm $(PHP_SCOPER_PHAR_BIN) || true
57+
$(MAKE) $(PHP_SCOPER_PHAR_BIN)
58+
59+
.PHONY: fixtures_composer_outdated
60+
fixtures_composer_outdated: ## Reports outdated dependencies
61+
fixtures_composer_outdated:
62+
@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)'
63+
@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)'
5764

5865
.PHONY: cs
59-
cs: ## Fixes CS
66+
cs: ## Fixes CS
6067
cs: gitignore_sort composer_normalize php_cs_fixer
6168

6269
.PHONY: cs_lint
@@ -87,28 +94,21 @@ gitignore_sort:
8794
phpstan: $(PHPSTAN_BIN)
8895
$(PHPSTAN)
8996

90-
.PHONY: build
91-
build: ## Builds the PHAR
92-
build:
93-
rm $(PHP_SCOPER_PHAR_BIN) || true
94-
$(MAKE) $(PHP_SCOPER_PHAR_BIN)
95-
96-
.PHONY: fixtures_composer_outdated
97-
fixtures_composer_outdated: ## Reports outdated dependencies
98-
fixtures_composer_outdated:
99-
@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)'
100-
@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)'
97+
.PHONY: autoreview
98+
autoreview: ## Runs the AutoReview checks
99+
autoreview: cs_lint phpstan covers_validator
101100

102101
.PHONY: test
103-
test: ## Runs all the tests
104-
test: validate_package covers_validator phpunit e2e
102+
test: ## Runs all the tests
103+
test: validate_package phpunit e2e
105104

106105
.PHONY: validate_package
107106
validate_package:
108107
composer validate --strict
109108

110109
.PHONY: composer_root_version_check
111110
composer_root_version_check: ## Runs all checks for the ComposerRootVersion app
111+
composer_root_version_check:
112112
cd composer-root-version-checker; $(MAKE) --file Makefile check
113113

114114
.PHONY: composer_root_version_lint
@@ -135,7 +135,7 @@ phpunit_coverage_infection: $(PHPUNIT_BIN) vendor
135135
$(PHPUNIT_COVERAGE_INFECTION)
136136

137137
.PHONY: phpunit_coverage_html
138-
phpunit_coverage_html: ## Runs PHPUnit with code coverage with HTML report
138+
phpunit_coverage_html: ## Runs PHPUnit with code coverage with HTML report
139139
phpunit_coverage_html: $(PHPUNIT_BIN) vendor
140140
$(PHPUNIT_COVERAGE_HTML)
141141

@@ -144,17 +144,22 @@ infection: $(COVERAGE_XML) vendor
144144
#infection: $(INFECTION_BIN) $(COVERAGE_XML) vendor
145145
if [ -d $(COVERAGE_XML) ]; then $(INFECTION); fi
146146

147+
include .makefile/e2e.file
148+
.PHONY: e2e
149+
e2e: ## Runs end-to-end tests
150+
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
151+
147152
.PHONY: blackfire
148-
blackfire: ## Runs Blackfire profiling
153+
blackfire: ## Runs Blackfire profiling
149154
blackfire: vendor
150155
@echo "By https://blackfire.io"
151156
@echo "This might take a while (~2min)"
152157
$(BLACKFIRE) run php bin/php-scoper add-prefix --output-dir=build/php-scoper --force --quiet
153158

154-
include .makefile/e2e.file
155-
.PHONY: e2e
156-
e2e: ## Runs end-to-end tests
157-
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
159+
.PHONY: clean
160+
clean: ## Cleans all created artifacts
161+
clean:
162+
git clean --exclude=.idea/ -ffdx
158163

159164

160165
#

tests/AutoReview/MakefileE2ETest.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,20 @@ protected function getExpectedHelpOutput(): string
4646
# Commands
4747
#---------------------------------------------------------------------------
4848
49-
[33mcheck:[0m Runs all checks
50-
[33mclean:[0m Cleans all created artifacts
51-
[33mupdate_root_version:[0m Checks the latest GitHub release and update COMPOSER_ROOT_VERSION accordingly
52-
[33mcs:[0m Fixes CS
49+
[33mcheck:[0m Runs all checks
50+
[33mbuild:[0m Builds the PHAR
51+
[33mfixtures_composer_outdated:[0m Reports outdated dependencies
52+
[33mcs:[0m Fixes CS
5353
cs_lint: Checks CS
54-
phpstan: Runs PHPStan
55-
build: Builds the PHAR
56-
outdated_fixtures: Reports outdated dependencies
57-
test: Runs all the tests
58-
check_composer_root_version: Checks that the COMPOSER_ROOT_VERSION is up to date
59-
phpunit_coverage_html: Runs PHPUnit with code coverage with HTML report
60-
blackfire: Runs Blackfire profiling
61-
e2e: Runs end-to-end tests
54+
autoreview: Runs the AutoReview checks
55+
test: Runs all the tests
56+
composer_root_version_check: Runs all checks for the ComposerRootVersion app
57+
composer_root_version_lint: Checks that the COMPOSER_ROOT_VERSION is up to date
58+
composer_root_version_update: Updates the COMPOSER_ROOT_VERSION
59+
phpunit_coverage_html: Runs PHPUnit with code coverage with HTML report
60+
e2e: Runs end-to-end tests
61+
blackfire: Runs Blackfire profiling
62+
clean: Cleans all created artifacts
6263

6364
EOF;
6465
}

0 commit comments

Comments
 (0)