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
4 changes: 2 additions & 2 deletions .github/workflows/check-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ on:
description: "Count changed PHPStan files"
value: ${{ jobs.check.outputs.phpstan }}
phpunit-test:
description: "Count changed PhpUnit test files"
description: "Count changed PHPUnit test files"
value: ${{ jobs.check.outputs.phpunit-test }}
phpunit:
description: "Count changed PhpUnit files"
description: "Count changed PHPUnit files"
value: ${{ jobs.check.outputs.phpunit }}
# Allow manually triggering the workflow.
workflow_dispatch:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,20 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-*

- name: Restore result cache
uses: actions/cache/restore@v4
with:
path: .php-cs-fixer.cache
key: php-cs-fixer-result-cache-${{ github.run_id }}
restore-keys: |
php-cs-fixer-result-cache-

- name: PHP-CS-Fixer
run: php vendor/bin/php-cs-fixer fix --diff --dry-run

- name: Save result cache
uses: actions/cache/save@v4
if: always()
with:
path: .php-cs-fixer.cache
key: php-cs-fixer-result-cache-${{ github.run_id }}
17 changes: 16 additions & 1 deletion .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,20 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-*

- name: Restore result cache
uses: actions/cache/restore@v4
with:
path: .phpcs.result.cache
key: phpcs-result-cache-${{ github.run_id }}
restore-keys: |
phpcs-result-cache-

- name: PHPCodeSniffer
run: php vendor/bin/phpcs -s -p --report=full --standard=.phpcs.dist.xml
run: php vendor/bin/phpcs -s -p --cache=.phpcs.result.cache --report=full --standard=.phpcs.dist.xml

- name: Save result cache
uses: actions/cache/save@v4
if: always()
with:
path: .phpcs.result.cache
key: phpcs-result-cache-${{ github.run_id }}
17 changes: 16 additions & 1 deletion .github/workflows/phpmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,20 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-*

- name: Restore result cache
uses: actions/cache/restore@v4
with:
path: .phpmd.result-cache.php
key: phpmd-result-cache-${{ github.run_id }}
restore-keys: |
phpmd-result-cache-
- name: PHPMD
run: php vendor/bin/phpmd app/code/core/Mage/ github .phpmd.dist.xml --baseline-file .phpmd.dist.baseline.xml
run: php vendor/bin/phpmd app/code/core/Mage/ github .phpmd.dist.xml --cache --baseline-file .phpmd.dist.baseline.xml

- name: Save result cache
uses: actions/cache/save@v4
if: always()
with:
path: .phpmd.result-cache.php
key: phpmd-result-cache-${{ github.run_id }}
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ jobs:
if: always()
with:
path: .phpstan.cache
key: phpstan-result-cache-${{ github.run_id }}
key: phpstan-result-cache-${{ github.run_id }}
25 changes: 16 additions & 9 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,28 +86,35 @@ jobs:
--enable_charts 'yes' \
--skip_url_validation 'yes'

- name: Restore result cache
uses: actions/cache/restore@v4
with:
path: .phpunit.result.cache
key: phpunit-result-cache-${{ matrix.php-versions }}-${{ matrix.mysql-version }}-${{ github.run_id }}
restore-keys: |
phpunit-result-cache-

- name: Run phpUnit
run: php vendor/bin/phpunit --configuration .phpunit.dist.xml

- name: Save result cache
uses: actions/cache/save@v4
if: always()
with:
path: .phpunit.result.cache
key: phpunit-result-cache-${{ matrix.php-versions }}-${{ matrix.mysql-version }}-${{ github.run_id }}

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: tests/logging/*.xml

- name: prepare SonarCloud Scan Data
if: ${{ (matrix.php-versions == '7.4') && (matrix.mysql-version == '5.7') }}
run: |
head tests/coverage/clover.xml
sed -i 's@'$GITHUB_WORKSPACE'/@/github/workspace/@g' tests/logging/junit.xml
sed -i 's@'$GITHUB_WORKSPACE'/@/github/workspace/@g' tests/coverage/clover.xml
head ./tests/coverage/clover.xml

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
continue-on-error: true
if: ${{ (matrix.php-versions == '7.4') && (matrix.mysql-version == '5.7') }} && SONAR_TOKEN
if: ${{ (matrix.php-versions == '8.1') && (matrix.mysql-version == '5.7') }} && SONAR_TOKEN
with:
args: >
-Dproject.settings=tests/sonar-project.properties
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,20 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-*

- name: Restore result cache
uses: actions/cache/restore@v4
with:
path: .rector.result.cache
key: rector-result-cache-${{ github.run_id }}
restore-keys: |
rector-result-cache-

- name: Rector
run: php vendor/bin/rector process --config .rector.php --dry-run

- name: Save result cache
uses: actions/cache/save@v4
if: always()
with:
path: .rector.result.cache
key: rector-result-cache-${{ github.run_id }}
6 changes: 2 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,14 @@ jobs:

rector:
name: Rector
needs: [check, php-cs-fixer]
needs: [check, php-cs-fixer, phpstan]
if: |
needs.check.outputs.php > 0 ||
needs.check.outputs.workflow > 0
uses: ./.github/workflows/rector.yml

# DOES NOT run by default
# runs on schedule or when workflow or unit tests changed
unit_tests:
name: Unit Tests (OpenMage)
name: PHPUnit Tests
needs: [check, php-cs-fixer]
if: |
needs.check.outputs.php > 0 ||
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,6 @@ app/etc/includes/ddev.xhgui.php

# local development
.localdev

# rector
.rector.result.cache
6 changes: 6 additions & 0 deletions .rector.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

declare(strict_types=1);

use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector as CodeQuality;
use Rector\CodingStyle\Rector as CodingStyle;
use Rector\Config\RectorConfig;
Expand All @@ -19,6 +21,10 @@

try {
return RectorConfig::configure()
->withCache(
cacheDirectory: '.rector.result.cache',
cacheClass: FileCacheStorage::class,
)
->withPhpSets(
php74: true,
)
Expand Down
Loading