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
14 changes: 14 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
types: [ opened, labeled, synchronize ]

name: Inspections

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
runPHPCSInspection:
if: contains(github.event.pull_request.labels.*.name, 'run analysis')
Expand All @@ -16,6 +21,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@master
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config --global cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-phpcs-${{ hashFiles('.github/workflows/phpcs.yml') }}
restore-keys: ${{ runner.os }}-composer-phpcs-
- name: Check PHPCS
run: |
export PHPCS_DIR=/home/runner/.composer/vendor/bin
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
types: [ opened, labeled, synchronize ]

name: PHPStan Code Analysis

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
phpstan:
if: contains(github.event.pull_request.labels.*.name, 'run analysis')
Expand All @@ -27,6 +32,17 @@ jobs:
ini-values: display_errors = on, error_reporting = E_ALL
tools: phpstan, composer

- name: "📂 Getting Composer Cache Directory"
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: "💾 Caching Composer Packages"
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-phpstan-${{ hashFiles('composer.lock', 'composer.json') }}
restore-keys: ${{ runner.os }}-composer-phpstan-

- name: "💽 Installing Composer Packages"
run: composer install

Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
types: [ opened, labeled, synchronize ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-test:
if: contains(github.event.pull_request.labels.*.name, 'run tests')
Expand All @@ -26,6 +30,15 @@ jobs:
- uses: shivammathur/setup-php@2.25.5
with:
php-version: ${{ matrix.php }}
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config --global cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php${{ matrix.php }}-composer-${{ hashFiles('composer.lock', 'composer.json') }}
restore-keys: ${{ runner.os }}-php${{ matrix.php }}-composer-
- name: Installing WordPress
run: |
export WP_DEVELOP_DIR=/tmp/wordpress/
Expand Down