Skip to content

Commit 3828245

Browse files
richardpringledannywillems
authored andcommitted
Use a single .nvm file for all node version refs
1 parent c383dc8 commit 3828245

File tree

15 files changed

+69
-17
lines changed

15 files changed

+69
-17
lines changed

.github/actions/frontend-build/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ inputs:
1515
default: 'false'
1616
node-version:
1717
description: 'Node.js version to use'
18-
required: false
19-
default: '23'
18+
required: true
2019

2120
runs:
2221
using: 'composite'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Read .nvmrc'
2+
description: 'Reads the .nvmrc file and outputs the node version'
3+
outputs:
4+
node_version:
5+
description: 'The Node.js version from .nvmrc'
6+
value: ${{ steps.nvm.outputs.NODE_VERSION }}
7+
runs:
8+
using: "composite"
9+
steps:
10+
- name: Read .nvmrc
11+
id: nvm
12+
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
13+
shell: bash

.github/workflows/docs.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
pull_request:
1010
workflow_dispatch:
1111

12-
env:
13-
NODE_VERSION: '20'
14-
1512
concurrency:
1613
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1714
cancel-in-progress: true
@@ -25,10 +22,13 @@ jobs:
2522
- name: Checkout repository
2623
uses: actions/checkout@v5
2724

25+
- id: nvm
26+
uses: ./.github/actions/read-nvmrc
27+
2828
- name: Setup Node.js
2929
uses: actions/setup-node@v6
3030
with:
31-
node-version: ${{ env.NODE_VERSION }}
31+
node-version: ${{ steps.nvm.outputs.node_version }}
3232
cache: 'npm'
3333
cache-dependency-path: website/package-lock.json
3434

@@ -109,10 +109,13 @@ jobs:
109109
- name: Setup Pages
110110
uses: actions/configure-pages@v5
111111

112+
- id: nvm
113+
uses: ./.github/actions/read-nvmrc
114+
112115
- name: Setup Node.js
113116
uses: actions/setup-node@v6
114117
with:
115-
node-version: ${{ env.NODE_VERSION }}
118+
node-version: ${{ steps.nvm.outputs.node_version }}
116119
cache: 'npm'
117120
cache-dependency-path: website/package-lock.json
118121

@@ -158,10 +161,13 @@ jobs:
158161
with:
159162
fetch-depth: 0
160163

164+
- id: nvm
165+
uses: ./.github/actions/read-nvmrc
166+
161167
- name: Setup Node.js
162168
uses: actions/setup-node@v6
163169
with:
164-
node-version: ${{ env.NODE_VERSION }}
170+
node-version: ${{ steps.nvm.outputs.node_version }}
165171
cache: 'npm'
166172
cache-dependency-path: website/package-lock.json
167173

.github/workflows/frontend-macos-13.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: nvm
20+
uses: ./.github/actions/read-nvmrc
21+
1922
- name: Frontend build
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.nvm.outputs.node_version }}
2226
test-build-commands: 'true'

.github/workflows/frontend-macos-14.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: nvm
20+
uses: ./.github/actions/read-nvmrc
21+
1922
- name: Frontend build
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.nvm.outputs.node_version }}
2226
test-build-commands: 'true'

.github/workflows/frontend-macos-15.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: nvm
20+
uses: ./.github/actions/read-nvmrc
21+
1922
- name: Frontend build
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.nvm.outputs.node_version }}
2226
test-build-commands: 'true'

.github/workflows/frontend-macos-latest.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: nvm
20+
uses: ./.github/actions/read-nvmrc
21+
1922
- name: Frontend build
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.nvm.outputs.node_version }}
2226
test-build-commands: 'true'

.github/workflows/frontend-ubuntu-22-04.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: nvm
20+
uses: ./.github/actions/read-nvmrc
21+
1922
- name: Frontend build
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.nvm.outputs.node_version }}
2226
test-build-commands: 'true'

.github/workflows/frontend-ubuntu-24-04-arm.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: nvm
20+
uses: ./.github/actions/read-nvmrc
21+
1922
- name: Frontend build
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.nvm.outputs.node_version }}
2226
test-build-commands: 'true'

.github/workflows/frontend.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ jobs:
1616
- name: Git checkout
1717
uses: actions/checkout@v5
1818

19+
- id: nvm
20+
uses: ./.github/actions/read-nvmrc
21+
1922
- name: Frontend build and test
2023
uses: ./.github/actions/frontend-build
2124
with:
25+
node-version: ${{ steps.nvm.outputs.node_version }}
2226
run-prettier-check: 'true'
2327
run-tests: 'true'
2428
test-build-commands: 'false'

0 commit comments

Comments
 (0)