Skip to content

Commit 91f2a2a

Browse files
aduthyouknowriaddesrosjdream-encode
authored
Testing: Test across OS and Node.js version for commits to trunk (#72946)
* Testing: Test across OS and Node.js version for commits to trunk * Temporarily re-include Windows for demonstration * Normalize expected line endings for Prettier * Normalize line endings at git checkout Consistent with expectations for tooling, e.g. editorconfig * Retain "All" label for default configuration * Use cross-spawn for improved Windows compatibility in licenses script * Revert "Temporarily re-include Windows for demonstration" This reverts commit efc4207. Co-authored-by: aduth <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: desrosj <[email protected]> Co-authored-by: dream-encode <[email protected]>
1 parent 3be8bb2 commit 91f2a2a

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Set the default behavior, in case people don't have `core.autocrlf` set.
2-
* text=auto
2+
* text=auto eol=lf
33

44
# Windows bat files in mobile/android.
55
*.bat -text

.github/workflows/static-checks.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,26 @@ permissions: {}
2121

2222
jobs:
2323
check:
24-
name: All
25-
runs-on: 'ubuntu-24.04'
24+
name: All${{ (matrix.node != '20' || matrix.os != 'ubuntu-24.04') && format(' (Node.js {0} on {1})', matrix.node, contains(matrix.os, 'macos-') && 'MacOS' || contains(matrix.os, 'windows-') && 'Windows' || 'Linux') || '' }}
25+
runs-on: ${{ matrix.os }}
2626
permissions:
2727
contents: read
2828
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
29+
strategy:
30+
matrix:
31+
event: ['${{ github.event_name }}']
32+
node: ['20', '22', '24']
33+
os: ['macos-15', 'ubuntu-24.04', 'windows-2025']
34+
exclude:
35+
# On PRs: Only test Node 20 on Ubuntu
36+
- event: 'pull_request'
37+
node: '22'
38+
- event: 'pull_request'
39+
node: '24'
40+
- event: 'pull_request'
41+
os: 'macos-15'
42+
- event: 'pull_request'
43+
os: 'windows-2025'
2944

3045
steps:
3146
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -36,9 +51,7 @@ jobs:
3651
- name: Use desired version of Node.js
3752
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3853
with:
39-
node-version-file: '.nvmrc'
40-
check-latest: true
41-
cache: npm
54+
node-version: ${{ matrix.node }}
4255

4356
- name: Npm install
4457
# A "full" install is executed, since `npm ci` does not always exit

bin/check-licenses.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* External dependencies
55
*/
6-
import { spawnSync } from 'node:child_process';
6+
import spawn from 'cross-spawn';
77

88
/**
99
* Internal dependencies
@@ -25,7 +25,7 @@ const ignored = [ '@ampproject/remapping', 'webpack' ];
2525

2626
/** @type {ReadonlyArray<PackageInfo>} */
2727
const workspacePackages = JSON.parse(
28-
spawnSync(
28+
spawn.sync(
2929
'npm',
3030
[
3131
'query',
@@ -42,7 +42,7 @@ const workspacePackages = JSON.parse(
4242
const packageNames = workspacePackages.map( ( { name } ) => name );
4343

4444
const dependenciesToProcess = JSON.parse(
45-
spawnSync(
45+
spawn.sync(
4646
'npm',
4747
[
4848
'ls',

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
"copy-webpack-plugin": "10.2.0",
106106
"core-js-builder": "3.39.0",
107107
"cross-env": "7.0.3",
108+
"cross-spawn": "^7.0.6",
108109
"css-loader": "6.2.0",
109110
"deep-freeze": "0.0.1",
110111
"equivalent-key-map": "0.2.2",

0 commit comments

Comments
 (0)