File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 7878 run : make phpstan_install
7979
8080 - run : make phpstan
81+ rector :
82+ runs-on : ubuntu-latest
83+ name : Rector
84+ steps :
85+ - name : Checkout
86+ uses : actions/checkout@v4
87+
88+ - name : Setup PHP
89+ uses : shivammathur/setup-php@v2
90+ with :
91+ php-version : ' 8.1'
92+ tools : composer
93+ coverage : none
94+
95+ # https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
96+ - name : Configure composer root version
97+ run : |
98+ source .composer-root-version
99+ echo "COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION}" >> $GITHUB_ENV
100+
101+ - name : Install Composer dependencies
102+ uses : ramsey/composer-install@v2
103+
104+ - name : Install PHPStan
105+ uses : ramsey/composer-install@v2
106+ with :
107+ working-directory : ' vendor-bin/rector'
108+
109+ - name : Ensure PHPStan Makefile target is up to date
110+ run : make rector_install
111+
112+ - run : make rector_lint
81113
82114 # This is a "trick", a meta task which does not change, and we can use in
83115 # the protected branch rules as opposed to the E2E tests one above which
90122 needs :
91123 - cs
92124 - phpstan
125+ - rector
93126 if : always()
94127 steps :
95128 - name : Successful run
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ phpstan: $(PHPSTAN_BIN)
9999
100100.PHONY : autoreview
101101autoreview : # # Runs the AutoReview checks
102- autoreview : cs_lint phpstan covers_validator
102+ autoreview : cs_lint phpstan rector_lint covers_validator
103103
104104.PHONY : test
105105test : # # Runs all the tests
@@ -274,6 +274,9 @@ vendor-bin/phpstan/composer.lock: vendor-bin/phpstan/composer.json
274274 @echo " $( @) is not up to date. You may want to run the following command:"
275275 @echo " $$ composer bin phpstan update --lock && touch -c $( @) "
276276
277+ .PHONY : rector_install
278+ rector_install : $(RECTOR_BIN )
279+
277280$(RECTOR_BIN ) : vendor-bin/rector/vendor
278281 touch -c $@
279282vendor-bin/rector/vendor : vendor-bin/rector/composer.lock $(COMPOSER_BIN_PLUGIN_VENDOR )
You can’t perform that action at this time.
0 commit comments