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
36 changes: 30 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
workflow_call:
pull_request:

# A new push to a PR makes the previous run for it obsolete, so cancel it.
# Pushes to develop and master still run to completion.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -28,13 +34,19 @@ jobs:
node-version-file: '.nvmrc'
cache: 'npm'

# Composer on the runner uses ~/.cache/composer, not ~/.composer/cache,
# so ask it for the directory instead of hard-coding one.
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache Composer
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php }}-
${{ runner.os }}-composer-${{ matrix.php-version }}-

- name: Install dependencies
run: npm ci
Expand All @@ -57,10 +69,14 @@ jobs:
with:
php-version: '8.5'

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache Composer
uses: actions/cache@v4
with:
path: ~/.composer/cache
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-phpstan-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-phpstan-
Expand Down Expand Up @@ -98,10 +114,14 @@ jobs:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache Composer
uses: actions/cache@v4
with:
path: ~/.composer/cache
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-unit-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-unit-
Expand Down Expand Up @@ -163,10 +183,14 @@ jobs:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache Composer
uses: actions/cache@v4
with:
path: ~/.composer/cache
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-e2e-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-e2e-
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<arg name="colors" />
<arg value="s" /><!-- Show sniff codes in all reports. -->
<arg name="severity" value="3" /><!-- Match WPVIP requirements. -->
<arg name="parallel" value="8" /><!-- Scan files in parallel processes; ignored when pcntl is missing. -->

<!-- Includes WordPress-Core, WordPress-Docs and WordPress-Extra rulesets. -->
<rule ref="WordPress" />
Expand Down
Loading