Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ utils/ export-ignore
.php-cs-fixer.user-guide.php export-ignore
structarmed-baseline.php export-ignore
structarmed.php export-ignore
phpmetrics.json export-ignore
phpstan-baseline.php export-ignore
phpstan-bootstrap.php export-ignore
phpstan.dist.neon export-ignore
Expand Down
76 changes: 0 additions & 76 deletions .github/workflows/test-autoreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,79 +30,3 @@ jobs:
php-version: '8.2'
job-id: auto-review-tests
group-name: AutoReview

composer-normalize-tests:
name: Check normalized composer.json
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup PHP
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0
with:
php-version: '8.2'

- name: Install dependencies
run: composer update

- name: Run on root composer.json
id: normalize-root-composer
if: ${{ always() }}
run: |
echo "ROOT_COMPOSER_RESULT<<RCR" >> $GITHUB_OUTPUT
echo "$(composer normalize)" >> $GITHUB_OUTPUT
echo "RCR" >> $GITHUB_OUTPUT

- name: Run on framework composer.json
id: normalize-framework-composer
if: ${{ always() }}
working-directory: admin/framework
run: |
echo "FRAMEWORK_COMPOSER_RESULT<<FCR" >> $GITHUB_OUTPUT
echo "$(composer normalize)" >> $GITHUB_OUTPUT
echo "FCR" >> $GITHUB_OUTPUT

- name: Run on starter composer.json
id: normalize-starter-composer
if: ${{ always() }}
working-directory: admin/starter
run: |
echo "STARTER_COMPOSER_RESULT<<SCR" >> $GITHUB_OUTPUT
echo "$(composer normalize)" >> $GITHUB_OUTPUT
echo "SCR" >> $GITHUB_OUTPUT

- name: Analyse normalization results
run: |
if [[ '${{ steps.normalize-root-composer.conclusion }}' == 'failure' ]]; then
echo 'Normalization of root composer.json encountered a problem.';
echo 'Please run it locally: `composer normalize`';
exit 1;
fi

if [[ ${{ contains(steps.normalize-root-composer.outputs.ROOT_COMPOSER_RESULT, 'Successfully normalized') }} == true ]]; then
echo 'Root composer.json is not yet normalized.';
exit 1;
fi

if [[ '${{ steps.normalize-framework-composer.conclusion }}' == 'failure' ]]; then
echo 'Normalization of framework composer.json encountered a problem.';
echo 'Please run it locally: `composer normalize -d admin/framework`';
exit 1;
fi

if [[ ${{ contains(steps.normalize-framework-composer.outputs.FRAMEWORK_COMPOSER_RESULT, 'Successfully normalized') }} == true ]]; then
echo 'Framework composer.json is not yet normalized.';
exit 1;
fi

if [[ '${{ steps.normalize-starter-composer.conclusion }}' == 'failure' ]]; then
echo 'Normalization of starter composer.json encountered a problem.';
echo 'Please run it locally: `composer normalize -d admin/starter`';
exit 1;
fi

if [[ ${{ contains(steps.normalize-starter-composer.outputs.STARTER_COMPOSER_RESULT, 'Successfully normalized') }} == true ]]; then
echo 'Starter composer.json is not yet normalized.';
exit 1;
fi
54 changes: 54 additions & 0 deletions .github/workflows/test-composer-normalize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Composer Normalize

on:
pull_request:
paths:
- '**/composer.json'
- '.github/workflows/test-composer-normalize.yml'
push:
paths:
- '**/composer.json'
- '.github/workflows/test-composer-normalize.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
composer-normalize:
name: Check normalized composer.json
runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Setup PHP
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0
with:
php-version: '8.2'
coverage: none

- name: Install dependencies
run: composer update --ansi --no-interaction --working-dir=utils

- name: Run on root composer.json
if: ${{ !cancelled() }}
run: composer normalize --ansi --dry-run --working-dir=utils "$GITHUB_WORKSPACE/composer.json"

- name: Run on framework composer.json
if: ${{ !cancelled() }}
run: composer normalize --ansi --dry-run --working-dir=utils "$GITHUB_WORKSPACE/admin/framework/composer.json"

- name: Run on starter composer.json
if: ${{ !cancelled() }}
run: composer normalize --ansi --dry-run --working-dir=utils "$GITHUB_WORKSPACE/admin/starter/composer.json"

- name: Run on utils composer.json
if: ${{ !cancelled() }}
run: composer normalize --ansi --dry-run --working-dir=utils
2 changes: 0 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@
"utils/vendor/bin/php-cs-fixer fix --ansi --verbose --diff --config=.php-cs-fixer.tests.php",
"utils/vendor/bin/php-cs-fixer fix --ansi --verbose --diff"
],
"metrics": "utils/vendor/bin/phpmetrics --config=phpmetrics.json",
"phpstan:baseline": [
"phpstan analyse --ansi --generate-baseline=utils/phpstan-baseline/loader.neon",
"split-phpstan-baseline utils/phpstan-baseline/loader.neon"
Expand All @@ -128,7 +127,6 @@
"analyze": "Run static analysis",
"cs": "Check the coding style",
"cs-fix": "Fix the coding style",
"metrics": "Run PhpMetrics",
"phpstan:baseline": "Run PHPStan then dump all errors to baseline",
"phpstan:check": "Run PHPStan with support for identifiers",
"test": "Run unit tests"
Expand Down
7 changes: 0 additions & 7 deletions phpmetrics.json

This file was deleted.

1 change: 0 additions & 1 deletion utils/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"ergebnis/composer-normalize": "^2.28",
"friendsofphp/php-cs-fixer": "^3.76",
"nexusphp/cs-config": "^3.26",
"phpmetrics/phpmetrics": "^2.8 || ^3.0rc6",
"vimeo/psalm": "^6.14"
},
"autoload": {
Expand Down
Loading