Skip to content

Commit 7abfa1b

Browse files
committed
refactor(ci): parameterize composite action and add concurrency
- Add php-version input to setup-wordpress action (default 8.2, was hardcoded 8.0 which didn't match any tested version) - Use .nvmrc for Node version in composite action - Add workflow-level concurrency with cancel-in-progress to all PR-triggered workflows, replacing the removed styfle/cancel action Relates to #411
1 parent 4e90f9d commit 7abfa1b

5 files changed

Lines changed: 22 additions & 2 deletions

File tree

.github/actions/setup-wordpress/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Set up WordPress
22
description: Sets up WordPress. Assumes mariadb is available as a service.
33

44
inputs:
5+
php-version:
6+
description: 'PHP version to use'
7+
required: false
8+
default: '8.2'
59
wp-version:
610
description: 'WordPress version to install'
711
required: false
@@ -13,15 +17,15 @@ runs:
1317
- name: Setup PHP w/ Composer & WP-CLI
1418
uses: shivammathur/setup-php@v2
1519
with:
16-
php-version: 8.0
20+
php-version: ${{ inputs.php-version }}
1721
extensions: mbstring, intl, bcmath, exif, gd, mysqli, opcache, zip, pdo_mysql
1822
coverage: none
1923
tools: composer:v2, wp-cli
2024

2125
- name: Setup Node.js
2226
uses: actions/setup-node@v4
2327
with:
24-
node-version: 18.x
28+
node-version-file: '.nvmrc'
2529

2630
- name: Get Composer cache directory
2731
id: composer-cache

.github/workflows/phpstan.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
paths-ignore:
66
- '**/*.md'
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
phpstan:
1014
runs-on: ubuntu-22.04

.github/workflows/schema-linter.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- develop
1111
- main
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
run:
1519
runs-on: ubuntu-22.04

.github/workflows/test-plugin.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
paths-ignore:
77
- '**/*.md'
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
test_plugin:
1115
runs-on: ubuntu-22.04

.github/workflows/wpcs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: WordPress Coding Standards
33
on:
44
pull_request:
55

6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
610
jobs:
711
wpcs:
812
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)