Skip to content

Commit

Permalink
Make STAN run local again and move other validation scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Jan 4, 2024
1 parent e484a5c commit 058f5a1
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 23 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ end_of_line = crlf
[*.yml]
indent_size = 2

[*.xml]
[psalm-baseline.xml]
indent_size = 2

[phars.xml]
indent_size = 2

[Makefile]
Expand Down
73 changes: 53 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,6 @@ jobs:
CAKE_TEST_AUTOQUOTE=1 vendor/bin/phpunit --testsuite=database
fi
- name: Run class deprecation aliasing validation script
if: always()
run: php contrib/validate-deprecation-aliases.php

- name: Run composer.json validation for split packages
if: always()
run: php contrib/validate-split-packages.php

- name: Run PHPStan for split packages
if: always()
run: php contrib/validate-split-packages-phpstan.php

- name: Prefer lowest check
if: matrix.prefer-lowest == 'prefer-lowest'
run: composer require --dev dereuromark/composer-prefer-lowest && vendor/bin/validate-prefer-lowest -m

- name: Submit code coverage
if: matrix.php-version == '8.1'
uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -217,7 +201,56 @@ jobs:
vendor/bin/phpunit --display-incomplete --display-skipped --testsuite=database
cs-stan:
uses: cakephp/.github/.github/workflows/cs-stan.yml@5.x
secrets: inherit
with:
check_tests: true
name: Coding Standard & Static Analysis
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, intl
coverage: none
tools: phive, cs2pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Composer install
uses: ramsey/composer-install@v2

- name: Install PHP tools with phive.
run: "phive install --trust-gpg-keys '${{ inputs.phive_keys }}'"

- name: Run phpcs
if: always()
run: vendor/bin/phpcs --report=checkstyle | cs2pr

- name: Run psalm
if: always()
run: tools/psalm --output-format=github

- name: Run phpstan
if: always()
run: vendor/bin/phpstan analyse --error-format=github

- name: Run phpstan for tests
if: ${{ inputs.check_tests }}
run: vendor/bin/phpstan analyse -c tests/phpstan.neon --error-format=github

- name: Run class deprecation aliasing validation script
if: always()
run: php contrib/validate-deprecation-aliases.php

- name: Run composer.json validation for split packages
if: always()
run: php contrib/validate-split-packages.php

- name: Run PHPStan for split packages
if: always()
run: php contrib/validate-split-packages-phpstan.php

- name: Prefer lowest check
if: matrix.prefer-lowest == 'prefer-lowest'
run: composer require --dev dereuromark/composer-prefer-lowest && vendor/bin/validate-prefer-lowest -m
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
"@cs-check",
"@test"
],
"cs-check": "phpcs --colors --parallel=16 -p src/ tests/",
"cs-fix": "phpcbf --colors --parallel=16 -p src/ tests/",
"cs-check": "phpcs --colors --parallel=16 -p",
"cs-fix": "phpcbf --colors --parallel=16 -p",
"phpstan": "phpstan analyse",
"psalm": "tools/psalm --show-info=false",
"stan": [
Expand Down
4 changes: 4 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<ruleset name="CakePHP Core">
<config name="installed_paths" value="../../cakephp/cakephp-codesniffer" />

<file>config/</file>
<file>src/</file>
<file>tests/</file>

<rule ref="CakePHP" />

<arg value="s"/>
Expand Down

0 comments on commit 058f5a1

Please sign in to comment.