Skip to content

Commit aab1b12

Browse files
ci: fix (#1099)
1 parent 7cc2789 commit aab1b12

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

.github/workflows/nodejs.yml

+24-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
strategy:
6868
matrix:
6969
os: [ubuntu-latest, windows-latest, macos-latest]
70-
node-version: [12.x, 14.x, 16.x, 18.x, 20.x]
70+
node-version: [12.x, 14.x, 16.x, 18.x, 20.x, 22.x]
7171
webpack-version: [latest]
7272

7373
runs-on: ${{ matrix.os }}
@@ -82,11 +82,21 @@ jobs:
8282
run: git config --global core.autocrlf input
8383

8484
- uses: actions/checkout@v4
85-
85+
- uses: actions/github-script@v7
86+
id: calculate_architecture
87+
with:
88+
result-encoding: string
89+
script: |
90+
if ('${{ matrix.os }}' === 'macos-latest' && ('${{ matrix['node-version'] }}' === '12.x' || '${{ matrix['node-version'] }}' === '14.x')) {
91+
return "x64"
92+
} else {
93+
return ''
94+
}
8695
- name: Use Node.js ${{ matrix.node-version }}
8796
uses: actions/setup-node@v4
8897
with:
8998
node-version: ${{ matrix.node-version }}
99+
architecture: ${{ steps.calculate_architecture.outputs.result }}
90100
cache: "npm"
91101

92102
- name: Install dependencies
@@ -110,7 +120,7 @@ jobs:
110120
strategy:
111121
matrix:
112122
os: [ubuntu-latest, windows-latest, macos-latest]
113-
node-version: [12.x, 14.x, 16.x, 18.x, 20.x]
123+
node-version: [12.x, 14.x, 16.x, 18.x, 20.x, 22.x]
114124

115125
runs-on: ${{ matrix.os }}
116126

@@ -120,11 +130,21 @@ jobs:
120130
run: git config --global core.autocrlf input
121131

122132
- uses: actions/checkout@v4
123-
133+
- uses: actions/github-script@v7
134+
id: calculate_architecture
135+
with:
136+
result-encoding: string
137+
script: |
138+
if ('${{ matrix.os }}' === 'macos-latest' && ('${{ matrix['node-version'] }}' === '12.x' || '${{ matrix['node-version'] }}' === '14.x')) {
139+
return "x64"
140+
} else {
141+
return ''
142+
}
124143
- name: Use Node.js ${{ matrix.node-version }}
125144
uses: actions/setup-node@v4
126145
with:
127146
node-version: ${{ matrix.node-version }}
147+
architecture: ${{ steps.calculate_architecture.outputs.result }}
128148
cache: "npm"
129149

130150
- name: Install dependencies

0 commit comments

Comments
 (0)