Skip to content

Commit 1d93fa2

Browse files
committed
Tune CI parallelism and read Node version from package.json
1 parent 15c74ac commit 1d93fa2

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/on-pull-request.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
strategy:
13-
fail-fast: false
13+
fail-fast: true
14+
max-parallel: 3
1415
matrix:
1516
php_version:
1617
- '5.4'
@@ -24,10 +25,20 @@ jobs:
2425
- name: Checkouting code...
2526
uses: actions/checkout@v5
2627

28+
- name: Read Node.js version from package.json
29+
id: node-version
30+
run: |
31+
NODE_VERSION=$(jq -r '.engines.node // empty' package.json)
32+
if [[ -z "$NODE_VERSION" || "$NODE_VERSION" == "null" ]]; then
33+
echo "package.json engines.node is required" >&2
34+
exit 1
35+
fi
36+
echo "version=$NODE_VERSION" >> "$GITHUB_OUTPUT"
37+
2738
- name: Setup Node.js
2839
uses: actions/setup-node@v4
2940
with:
30-
node-version: 22
41+
node-version: ${{ steps.node-version.outputs.version }}
3142

3243
- name: Enable legacy Docker schema v1 pulls for old PHP tags
3344
run: |

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"scripts": {
66
"test": "node --test tests/*.test.js"
77
},
8+
"engines": {
9+
"node": "22"
10+
},
811
"devDependencies": {
912
"testcontainers": "^10.20.0"
1013
}

0 commit comments

Comments
 (0)