diff --git a/.github/workflows/php-cs-on-changes.yml b/.github/workflows/php-cs-on-changes.yml index 84b6f5c3b..975317b6c 100644 --- a/.github/workflows/php-cs-on-changes.yml +++ b/.github/workflows/php-cs-on-changes.yml @@ -1,10 +1,8 @@ name: PHP Coding Standards - PR Changed Files on: - pull_request: - paths: - - "**.php" - - .github/workflows/php-cs-on-changes.yml + pull_request: { } + # run on all PRs concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -16,7 +14,7 @@ jobs: timeout-minutes: 15 strategy: matrix: - php: [7.4, 8.3] + php: [ 7.4, 8.3 ] name: Code sniff (PHP ${{ matrix.php }}, WP Latest) permissions: contents: read @@ -45,3 +43,7 @@ jobs: - name: Run PHPCS if: steps.changed-files.outputs.any_changed == 'true' run: vendor/bin/phpcs-changed --warning-severity=0 -s --git --git-base ${{ github.event.pull_request.base.sha }} ${{ steps.changed-files.outputs.all_changed_files }} + + - name: Skip PHPCS - No PHP Files Updated + if: steps.changed-files.outputs.any_changed != 'true' + run: echo "No PHP files changed; skipping PHPCS checks." diff --git a/.github/workflows/php-unit-tests.yml b/.github/workflows/php-unit-tests.yml index a79d68350..970b8c21f 100644 --- a/.github/workflows/php-unit-tests.yml +++ b/.github/workflows/php-unit-tests.yml @@ -1,21 +1,6 @@ name: PHP Unit Tests -on: - push: - branches: - - trunk - - develop - paths: - - "**.php" - - composer.json - - composer.lock - - .github/workflows/php-unit-tests.yml - pull_request: - paths: - - "**.php" - - composer.json - - composer.lock - - .github/workflows/php-unit-tests.yml +on: [ push, pull_request ] # Run on all pushes and PRs concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -30,9 +15,9 @@ jobs: WP_TESTS_DIR: "/tmp/wordpress/tests/phpunit" strategy: matrix: - php: [7.4, 8.3] - wp-version: [latest] - wc-version: [latest] + php: [ 7.4, 8.3 ] + wp-version: [ latest ] + wc-version: [ latest ] steps: - name: Install SVN